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
Why Prithvi Narayan Shah are appointed the person favoured by the people at Kazi
mart [117]

Answer:

At one time, Prithvi Narayan Shah could not decide who he should as the Kaji (equivalent to Prime Minister) and Pradhan Senapati (Commander-in-Chief). He had two commanders Biraj Thapa Magar and Kalu Pande in mind.

So, for the decision, he called a Bhaardaari Sabhaa (assembly of the courtiers) along with some people of his kingdom and chose Kalu Pande on the basis of popularity. He instructs his descendants in Divyopadesh to understand the popularity before nominating someone as the Kaji.

This is not a true democratic system as the candidates don't really come from between the people. The candidates are the two people who the King thinks are capable and only wants to know who is popular. This only seems like a precursor of democracy we have today.

I would not call Prithvi Narayan Shah was a democratic king, though

Explanation:

3 0
3 years ago
Jasper and Samantha are in a robotics competition. The guidelines state that the robots should be able to move a 10-gram weight
Inessa [10]

Answer:

evaluating a solution

Explanation:

just did the test :)

4 0
3 years ago
You started using a new Windows server three months ago. Since that time, you have found that the system slows down and crashes
Brut [27]

Answer: Open Reliability Monitor.

Explanation:

The simplest way to view this information is to open the reliability monitor.

The Reliability Monitor shows you the stability history of a system at a glance and also allows one to see the details of the events that has an effect on reliability on a daily basis.

The reliability and problem history chart which can be seen in the Reliability Monitor helps in keeping track of the overall health of the server on a daily basis.

4 0
3 years ago
Finish the code where it says //YOUR CODE HERE
victus00 [196]

Answer:This is basically the issue of permutations and calculations. It revolves around the best depiction of accuracy.

Explanation: It hitherto explains the nitty-gritty of our day-to-day activities in connection with our social interactions and securities...

6 0
3 years ago
Why are video games addictive????<br> please write at least 3 reasons
timurjin [86]
It’s many people’s hobby
It gives a sense of adrenaline
You will try on and on to win or finish the mission
5 0
4 years ago
Other questions:
  • William would like to sort a list of items after the data is already entered.
    9·1 answer
  • The Middle East links which two countries
    10·2 answers
  • Private sharing model on Opportunities. Leadership has asked the Administrator to create a new custom object that will track cus
    7·1 answer
  • Does Congress have a role in determining FAA regulations? If so, what is it?
    11·1 answer
  • Two threads try to acquire the same resource at the same time and both are blocked. Then, they continually change their states i
    14·1 answer
  • Rey is recording the dialogues and sound effects separately in the studio, as he is not happy with the sound quality recorded on
    9·1 answer
  • Which of these is NOT a reason for an IP Address?
    15·2 answers
  • What is the difference between ionizing and non-ionizing radiation?
    7·2 answers
  • A central issue of public sharing is:
    13·2 answers
  • It is recommended that systems administrators analyze logs in order to determine if they have been altered because monitoring ca
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!