a variable ‘name’ to store name of the month
an int array days can hold 28 30 or 31 values. Days used to store max daily temps
Constructor to specify size array & month name
setDays to specify size of array
setMonth stores name of month in name variable
getMonth to return name of the month
setTemps to allow all temps for that month to be entered into the days array
getTemp returns temp on a specified day
App program:
Creates an array of Month objects called Year & assigns appropriate names & num of days to each month
Create loop in the program to allow the temps for Jan & Feb to be entered
Display temp on 3rd Jan & 15th Feb
Write a method to display the highest temp in the 2 months & date on which it occurred
Find avg temp in a specified month
Find range of temps in a specified month (highest – lowest temp)
Find number of days in a specified month that the temp was higher than a specified value
The answer to the question is available in the PDF file https://assignmentexpert.com/https://assignmentexpert.com/homework-answers/programming-answer-59395.pdf
Comments
Leave a comment