I want to track my allowance savings. Let me keep typing inamounts I put into the piggy bank, and when I type 0 to meanI'm done, tell me the total.Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
Only one-star challenges have this section. If you already know how to begin, skip it — and when you move up to two stars, working out the order yourself is part of the job.
double starting at 0.while (amount != 0), add the amount to the total inside, then read the next amount as the last line in the loop.:F2.Amount (0 to stop): 5 [Enter]Amount (0 to stop): 10 [Enter]Amount (0 to stop): 20 [Enter]Amount (0 to stop): 0 [Enter]
Total saved: $35.00Verified in a real run — 5, 10, and 20 add up to exactly $35.00, and the 0 that stops the loop never gets added.
Your requirements list and your program file, named cc-piggy-bank.