1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
blondinia [14]
3 years ago
13

Python: Write a program for a small restaurant that sells pizzas. You may consider it as a prototype of a realistic online appli

cation. Basically, your program allows a user to enter one’s name and information about pizzas that the user wants to order. It then calculates and displays the subtotal, sales tax, and total cost of the order.
Given below is a typical dialog between a user and your program when the user interacts with your program to place an order of one or more pizzas. Note that the text in black is program output, such as asking the user for certain input or displaying relevant information for the user, and the text in red is the user’s response to a prompt from your program.

Enter your name: John

Enter the number of pizzas you want to order: 2

Pizza Size and Cost

- Small (10 inch, $7.95), Medium (12 inch, $9.95), and Large (14 inch, $11.95) Enter the size of your pizzas: Medium

Available Topping and Cost Per Topping

- Ham, Mushrooms, Onions, Green Peppers, Black Olives, Tomatoes, Pineapple, Spinach

- $0.75 each for Small Pizza, $0.95 each for Medium Pizza, and $1.15 each for Large Pizza Enter the number of toppings on your pizzas: 3

Enter your choices of toppings: Onions, Pineapple, Spinach

Order Summary

Customer name: John

2 Medium Pizzas with Toppings Onions Pineapple Spinach

Subtotal:

Sales Tax (6.0%): Total Cost:

$22.15 $1.33 $23.48

Develop your program according to the dialog above.
Computers and Technology
1 answer:
katrin2010 [14]3 years ago
7 0

Answer:

Name: tyler

Number of pizzas: 2

Small (10 inch, $7.95), Medium (12 inch, $9.95), and Large (14 inch, $11.95)

Pizza size: large

Available toppings: Ham, Mushrooms, Onions, Green Peppers, Black Olives, Tomatoes, Pineapple, Spinach

$0.75 each for Small Pizza, $0.95 each for Medium Pizza, and $1.15 each for Large Pizza

Number of toppings: 2

Enter topping number 1: ham

Enter topping number 2: onions

Order Summary:  

Customer Name: tyler

2 large pizzas with ['ham', 'onions']        

Subtotal | Sales Tax (6%) | Total Cost        

26.2 | 1.5719999999999998 | 27.772

Explanation:

name = input("Name: ")

num_pizzas = int(input("Number of pizzas: "))

print("Small (10 inch, $7.95), Medium (12 inch, $9.95), and Large (14 inch, $11.95)")

pizza_size = input("Pizza size: ").lower()

print("Available toppings: Ham, Mushrooms, Onions, Green Peppers, Black Olives, Tomatoes, Pineapple, Spinach")

print("$0.75 each for Small Pizza, $0.95 each for Medium Pizza, and $1.15 each for Large Pizza")

num_toppings = int(input("Number of toppings: "))

toppings = []

subtotal = 0

tax = 0

total = 0

for i in range(1,num_toppings + 1):

   toppings.append(input(f"Enter topping number {i}: "))

if pizza_size == 'small':

   subtotal += num_pizzas * 7.95

   subtotal += num_toppings * 0.75

   tax += subtotal * 0.06

   total += subtotal + tax

   print("Order Summary: ")

   print(f"Customer Name: {name}")

   print(f"{num_pizzas} {pizza_size} pizzas with {toppings}")

   print("Subtotal | Sales Tax (6%) | Total Cost")

   print(f"{subtotal} | {tax} | {total}")

if pizza_size == 'medium':

   subtotal += num_pizzas * 9.95

   subtotal += num_toppings * 0.95

   tax += subtotal * 0.06

   total += subtotal + tax

   print("Order Summary: ")

   print(f"Customer Name: {name}")

   print(f"{num_pizzas} {pizza_size} pizzas with {toppings}")

   print("Subtotal | Sales Tax (6%) | Total Cost")

   print(f"{subtotal} | {tax} | {total}")

if pizza_size == 'large':

   subtotal += num_pizzas * 11.95

   subtotal += num_toppings * 1.15

   tax += subtotal * 0.06

   total += subtotal + tax

   print("Order Summary: ")

   print(f"Customer Name: {name}")

   print(f"{num_pizzas} {pizza_size} pizzas with {toppings}")

   print("Subtotal | Sales Tax (6%) | Total Cost")

   print(f"{subtotal} | {tax} | {total}")

You might be interested in
The format painter button is found in the ____ group on the home tab of the ribbon.
Amanda [17]
<span>The format painter button is found in the <u><em>clipboard</em></u><em> </em>group on the home tab of the ribbon</span>
6 0
3 years ago
In the circuit seen here, the resistor has a resistance of 3 ohms. If no change in the battery size occurs, what will happen to
Rufina [12.5K]

It will increase by a factor of 2

6 0
3 years ago
Read 2 more answers
Amelia is going to school to get a degree in Early Childhood Education. She wants to open her own daycare after she graduates. W
Yanka [14]
She could volenteer at a day care at the weekend or study child development/care whilst she is still at school.
8 0
3 years ago
This type of software works with end users, application software, and computer hardware to handle the majority of technical deta
Lena [83]
System software will be the answer
3 0
4 years ago
Frank listed the steps for attaching a file to an e-mail. Step 1: Create the message. Step 2: Click Attach File in the Include g
Leya [2.2K]
Step 1: Create the message was frank's error in sending a file to an e-mail. This is because, when sending a copy of an e-mail the sender must make sure to input the e-mail address of the receiver on the top of the message box. This way the sender will be sure to submit his attachment to the receiver properly.
5 0
4 years ago
Read 2 more answers
Other questions:
  • A school librarian has been asked to identify inappropriate Internet usage. Which students would most likely be reported to the
    5·2 answers
  • Materials that allow electricity to flow are called A) Metals B) Attractors C) Conductors D) Insulators
    11·2 answers
  • Which tool will be useful in darkening a subject’s hair color in a photograph? A.Dodge tool B.Burn tool C.Patch tool D.Blur tool
    5·2 answers
  • 1. Write a program to prompt the user to enter a single character and respond back whether or not the character is valid dna. 2.
    12·1 answer
  • Asking yourself questions can help you think of what to _____, in order to get answers.
    8·1 answer
  • How to make changes to a file on the USB drive
    6·2 answers
  • Please check my answer! (Java)
    7·1 answer
  • What is the processing speed for the second generation of computers​
    15·1 answer
  • State one device that may be found on a computer monitor that is used for video conferencing
    12·1 answer
  • _______ is a very common approach to multisystem authorization.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!