Question: Hello, I am trying to write a pizza program with Python coding: Instructions: You will write a program to calculate the cost of a pizza.
Hello, I am trying to write a pizza program with Python coding:
Instructions:
You will write a program to calculate the cost of a pizza.
The base cost of a pizza is as follows:
Small $
Medium $
Large $
Toppings are extra and their price depends on the size of pizza. To simplify your program, we only care about how many toppings are on the pizza, not exactly what they are. The cost of the toppings is as follows:
Small $
Medium $
Large $
You can also add extra sauce to any pizza for $
Finally, there is a sales tax of
Your program should prompt the user for all the required information and then print out the subtotal, amount of tax, and the total.
Example Output:
How many pizzas would you like?
For pizza :
What size pizza would you like? Small Medium, Large: Small
How many toppings would you like?
Would you like extra sauce for $YN Y
A Small pizza with toppings and extra sauce is $
For pizza :
What size pizza would you like? Small Medium, Large: Medium
How many toppings would you like?
Would you like extra sauce for $YN N
A Medium pizza with toppings is $
For pizza :
What size pizza would you like? Small Medium, Large: Large
How many toppings would you like?
Would you like extra sauce for $YN Y
A Large pizza with toppings and extra sauce is $
Subtotal: $
Tax : $
Total: $
My code so far does not produce an output for 'Bill' variable for some reason.:
amount inputHow many pizzas would you like to order?:
pizzaNumber printFor pizza :
size inputWhat size would you like? Small, Medium, Large:
toppings inputHow many toppings would you like?:
sauce inputWould you like extra sauce for $YN:
Bill
if size 'Small, small, s S:
Bill
elif size 'Medium, medium, m M:
Bill
elif size 'Large, large, l L:
Bill
if sauce Y Yes, YES' and size 'Small, small, s S:
Bill
if sauce Y Yes, YES' and size 'Medium, medium, m M:
Bill
if sauce Y Yes, YES' and size 'Large, large, l L:
Bill
if toppings and size 'Small, small, s S:
Bill
if toppings and size 'Medium, medium, m M:
Bill
if toppings and size 'Large, large, l L:
Bill
print subtotal: $Bill
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
