Unit 2 Task 38: Live class average

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 2 Task 38 - Live class average

← Unit 2 tasks · Solution


Teachers enter marks between 0 and 100. After each valid mark, print the running average so far.

Invalid marks (outside 0–100) should be ignored with a short message.

When the user enters -1, stop and print Done.

Skills: running sum and count, while, if.