Create an I/O design for the following problem statement. Hint: There should be a total of 7 variables. The output should have 6 variables – the overall bill, tip, and total and then the split amount for all three of these for each member of the party.
Problem Statement: Imagine that you and a number of friends go to a luxury restaurant, and when you ask for the bill you want to split the amount and the tip (15 percent) between all. Your program should print the amount of the bill, the tip, the total cost, and the amount each person has to pay. It should also print how much of what each person pays is for the bill and for the tip.
To design the I/O for the given problem statement, we will define the input and output variables clearly. The program will take the necessary inputs and then compute the required outputs based on those inputs.
Enter the total bill amount: 200.00
Enter the number of people in the party: 4
Total Bill Amount: $200.00
Tip Amount (15%): $30.00
Total Amount (Bill + Tip): $230.00
Each person pays for the bill: $50.00
Each person pays for the tip: $7.50
Each person pays total: $57.50
Summary:
- Total Bill: $200.00
- Total Tip: $30.00
- Total Amount: $230.00
- Amount per person for the bill: $50.00
- Amount per person for the tip: $7.50
- Total amount per person: $57.50