Unit 2 Task 1: Running total at the bake sale

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

Unit 2 Task 1 - Running total at the bake sale

← Unit 2 tasks · Solution


You are helping at a school bake sale. After each customer, you type how many dollars they paid (use decimals if needed). When there are no more customers, you enter 0 to finish.

Write a program that:

Use a loop with break when the sentinel value is entered.

Skills: variables, while, if, float, accumulation.