CJCoding With Joseph
15free / daySign inCreate account

Weekly Temperature Report

An array<double, 7> named temps holds one temperature per day of the week: {24.5, 26.0, 31.5, 22.0, 28.0, 25.5, 27.3}.

Find the highest value, the lowest value and the average (sum divided by 7), then print three lines labelled High, Low and Average, as shown in Expected Output. Print every number with exactly one decimal place using fixed and setprecision(1) from <iomanip>.

Expected Output:

High: 31.5
Low: 22.0
Average: 26.4

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
STL Containersstd::array
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.