Write a program that calculates the total amount of a meal purchased at a restaurant.

ASSIGNMENT

Write a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, then calculate the amounts of an 18 percent tip and a 7 percent sales tax. Display each of these amounts and the total.

After your read the program directions, for those of you wondering where to start…remember INPUT, PROCESSING, OUTPUT

Design – Think of what variables you will need. Perhaps write them out on scratch paper. Make your variables have MEANINGFUL names so that you know WHY you are creating them and the purpose they will serve.

Below are design instructions. Once you have completed this assignment you will upload the text file with your Python code. Also, in comments put in your repl.it link from browser like you did for program 1.99

MAKE SURE you put Comments at top of program, listing your name, Name of your program, and a brief description of your program.

INPUT SECTION

The program should ask the user to input the charge for food.

PROCESSING SECTION

Your program will calculate the amount for an 18 percent tip and 7 percent sales tax. NOTE: The tip is calculated BEFORE you add in the tax. In other words, if I had a 10.00 charge for food, my tip would be 18% of 10.00, which is 1.80

Tax is ALSO calculated on JUST the amount of food purchased. Again, if I had bought 10.00 worth of food, tax of 7% of 10.00 would be .70 cents

OUTPUT

2 digits of precision to the right of decimal point for output

Sample output run is shown below. User input is highlighted in bold

Enter the charge for food: 78.54

Tip: $ 14.14

Tax: $ 5.50

Total: $ 98.17

 

Write a program that calculates the total amount of a meal purchased at a restaurant.
Scroll to top