Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Q5: The class described for this question will be used for the rest of the quest

ID: 3721450 • Letter: Q

Question

Q5: The class described for this question will be used for the rest of the questions. For this question, create this class with a single 1 D array variable . Then write a constructor for this class based on the instruction given.

Q6: You will need to pass argument that take in the day of the week (as int where 0 is Monday...) as well as the new temperature that is going to be assigned for this day (you need to determine the data the to be used for temperature values). This method will be used for changing the temperature of a day at a time. This method belongs to the class DailyTemps defined in Q5

Q7: This method also belongs to the class DailyTemps and returns the number of days with below freezing temps. (determine what the return data type will be.

Q8: a method that returns the index value of the day with the warmest temperature

Q9: This toString method for the DailyTemps class will print the temperatures stored in the temp array in the format shown in the example for this question.

Q10: Write a test program (this will be another class) that will create an object of type DailyTemps and test EVERY method out. Be careful when testing the toString method. Follow the process illustrated in class for your homework assignment.

Explanation / Answer

Please find my implementation.

Output:

Enter Monday's temperature(F):
45
Enter Tuesday's temperature(F):
65
Enter Wednesday's temperature(F):
67
Enter Thursday's temperature(F):
87
Enter Friday's temperature(F):
56
Enter Saturday's temperature(F):
66
Enter Sunday's temperature(F):
76
0
3
Monday 45
Tuesday 65
Wednesday 67
Thursday 87
Friday 56
Saturday 66
Sunday 76

Process finished with exit code 0