← Back to Loops
Question 95
Running Step Count
Running Step Count
You have an array of steps walked on each of four days. Loop through the array using an index and print a line for each day showing the running total so far, in the form "Day 1: 1000". The running total should add up all the steps from the first day through the current day, so it keeps growing as you go.
Expected Output:
Day 1: 1000 Day 2: 3500 Day 3: 5000 Day 4: 8000
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.