12ArraysHard15 marks
A weather monitoring station records the number of minutes of sunshine for each day of a month.
The one-dimensional (1D) array Sunshine[] is used to store the number of minutes of sunshine for each day. The index of the array represents the day.
The one-dimensional (1D) array MonthDays[] contains the number of days in each month. The index of the array represents the month. In this array, 28 is stored in index 2 for the month of February. However, there are 29 days in February in a leap year.
In this program, a leap year is a year that divides by 4 with no remainder. For example, 2026 is not a leap year but 2028 will be a leap year.
Write a program that meets the following requirements:
• allows the user to input a year, calculates whether it is a leap year and updates the number of days in February as appropriate
• allows a user to input the name of one of the first three months of the year: January, February or March
• allows a user to input the number of minutes of sunshine for each day of the month and validates the input
• calculates the total amount of sunshine for the month in hours and minutes
• finds the highest amount of daily sunshine for the month
• outputs the:
◦ year
◦ month
◦ total amount of sunshine for the month in hours and minutes
◦ the highest amount of daily sunshine for the month.
You must use pseudocode or program code and add comments to explain how your code works.
Do not declare any arrays or variables; assume that this has already been done.
All inputs and outputs must contain suitable messages.
Answer
0 words