Task 9 of 9 · 0 solved · 9 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

Problem

5.2 Array algorithms — capstone: sum and max

Read a count and then that many numbers into an array. Print the total on the first line and the largest value on the second.

Write two methods — one for the total, one for the largest — and call them from main.

For 3 then 3 5 7:

15
7

Careful with all-negative input: start the search from the first element, not from 0.

time 1000 ms memory 256 Mb
Solution
Attempts: 0 A hint guides you to the fix — it never writes the code for you.
✦
Ready to check

Press «Submit» to run your code against the task's test cases — that is what sets your score. «AI review» is an optional second opinion: it reads your code — logic and style, not just the output — and suggests the next step without handing over the answer. It never changes your score.

Next module →
Working…