Practice
Weekly Temperature Grid Average
2024/Oct/Nov·Variant 3
MEDIUMArrays
A 2D array Temps stores two readings (morning, afternoon) for each of 3 days: Temps[1] is the morning row, Temps[2] is the afternoon row, and the second index is the day. Read all six readings, then output the overall average of all six, rounded to 1 decimal place.
Input: 6 real numbers (row by row: 3 morning readings, then 3 afternoon readings).
Output: Average temperature: <average to 1 dp>.
Example:
Input: 10
12
14
18
20
22
Output: Average temperature: 16
Premium is coming soon. All grading features are currently unlocked.
Sample Test Cases
Test 1: Whole-number average
Inputs: 10, 12, 14, 18, 20, 22
Expected: Average temperature: 16
Test 2: All readings equal
Inputs: 20, 20, 20, 20, 20, 20
Expected: Average temperature: 20