Question: Write a program to calculate the total for a fast food order The menu is: burger is $ 1 . 9 9 fries are $
Write a program to calculate the total for a fast food order
The menu is:
burger is $
fries are $
drink is $
chicken is $
Prompt the user for an item and a quantity
Calculate the price for that item
Add it to the subtotal
Print the subtotal of the order after each entry rounded to decimal places
Prompt if there is more to enter
Print the order total at the end rounded to decimal places
Do NOT round as you are doing the calculations. ONLY do the rounding within the print
You MUST have functions in addition to main
One function should get the item and quantity from the user. It needs to return values
The second function should calculate the price for a single entry given an item and quantity
Sample Run #bold underlined text is what the user types:
Item? burger
Qty
Subtotal $
More? y
Item? fries
Qty
Subtotal $
More? y
Item? chicken
Qty
Subtotal $
More? y
Item? drink
Qty
Subtotal $
More? n
Order total: $
Note that this in an introductory level class and this problem is meant to be completed using def functions, and other simple level functions. No class type functions are meant to be used.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
