Final answer:
Tuan's mother can use a simple algorithm to total up the sales by initializing a 'total' variable, sequentially entering bill amounts and adding them to the total, and printing the total when a zero is entered to end the input sequence.
Step-by-step explanation:
Algorithm to Calculate Total Sales
To assist Tuan's mother in totaling up the sales at the end of the day, a simple algorithm can be written for entering the amounts and calculating the total sales. This algorithm can be implemented in a computer program or even a calculator that allows for iterative operations. Here's a step-by-step approach:
- Initialize a variable to hold the total amount. Let's call it 'total' and set it initially to 0.
- Prompt Tuan's mother to enter the amount of a bill.
- Add the entered amount to the 'total' variable.
- Ask Tuan's mother if there is another bill to add. If so, go back to step 2.
- If zero is entered, end the input loop and print out the total amount.
This loop will continue to collect bill amounts until zero is input, signaling the end of the day's transactions. Then, the algorithm will output the total amount collected for the day.