Practice
Monthly Sunshine Totals
2026/May/June·Variant 1·Q12·[15 marks]
HARDArrays
Sunshine is stored in minutes. For this practice version January has 3 days, February has 2 (3 in a leap year), and March has 3. A year is treated as a leap year when MOD(Year, 4) = 0.
Read the year, then the month name. Set February's length from the leap-year test. Then read that many daily totals, each validated to 0–1440 inclusive.
Output the month total as hours and minutes, and the highest single day in minutes.
Input: Year, month name, then one integer per day of that month.
Output: Total: <h> hours <m> minutes then Highest: <n> minutes.
Example:
Input: 2024
February
60
120
180
Output: Total: 6 hours 0 minutes
Highest: 180 minutes
Sample Test Cases
Test 1: Leap year February has three days
Inputs: 2024, February, 60, 120, 180
Expected: Total: 6 hours 0 minutes
Highest: 180 minutes
Test 2: Non-leap February has two days
Inputs: 2023, February, 60, 90
Expected: Total: 2 hours 30 minutes
Highest: 90 minutes