Iteration (Restaurant Bill)

Initial Deadline:
11:00pm, Friday November 5, 2021

Write a program that calculate the amount owed by customers in a restaurant. For each table, the prompt the user for how many people are at the table. Then prompt the user for the per person meal cost for each person at the table. Finally, produce a bill that shows the subtotal, sales tax, tip, and total cost.

The program must continue processing tables until the number of the people at the table is 0 (this is the sentinel value.)

Sales tax is calculated on the subtotal and is 6%. The tip is also calculated on the subtotal. The tip is 18% if the number of people at the table is less than 5. The tip is 20% if the number of people at the table is 5 or more.

Here is an example input to the program:

Number of People Items
3 $7.99, $8.99, $12.45
5 $11.56, $12.34, $10.00, $15.45, $16.77
1 $13.23
7 $5.66, $12.34, $14.55, $10.99, $9.23, $8.99, $11.23
0