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
What is the platform-neutral programming language that can run on Windows, Macintosh, or UNIX?
nadezda [96]

Answer:

java

Explanation:

4 0
3 years ago
Your company has 1,000 users in a Microsoft Office 365 subscription. A Power BI administrator named Admin1 creates 20 dashboards
AysviL [449]

Answer:

Yes, it is.

Explanation:

Yes it will surely achieve the goal. When there is no license for user, then he/she will not access the dashboard.

7 0
3 years ago
How many basic elements of QBASIC are there
Masteriza [31]
<h2>6</h2>

The elements used in Qbasic:

  • Character set.
  • Variables.
  • Constants.
  • Operator and Operands.
  • Expression.
  • Statements.
6 0
3 years ago
3.3 Code Practice: Question 1
Bezzdna [24]

Answer:

day=int(input(“Enter today’s day numerically: ”))

if(day ==15 or day ==30):

print(“It’s payday!”)

if(day !=15 and day !=30):

print(“Sorry, not a payday.”)

Explanation:Good luck!

6 0
4 years ago
Which type of packet is sent by a dhcp server after receiving a dhcp discover message?
emmasim [6.3K]
A<span> DHCPOffer packet is sent to the client.</span>
5 0
3 years ago
Other questions:
  • Double clicking a word selects the entire word?
    9·2 answers
  • A​ __________ is a commonly used tool for showing how the parts of a whole are distributed.
    11·1 answer
  • Answer all 1).The most common layout of keys on the keyboard is the _____ keyboard. ASDF QWERTY JKL QWOPY,
    5·2 answers
  • To move one screen to the left press ____.
    9·1 answer
  • How do you ask brainy a question without it not liking the question and saying it hurts their feelings?
    14·1 answer
  • Maria works for MegaCorp, a large privately owned company specializing in sales of ball bearings. MegaCorp introduces filtering
    15·1 answer
  • You have the templates of 2 classes, Person and Program. The Person class has 4 attributes, name, age, major and gpa. There is a
    7·1 answer
  • Technology trends in education play a key role in a student’s
    15·1 answer
  • Bob has 2 candy bars he is fat what hapennes
    5·2 answers
  • Agent Phil Coulson developed this program to register Avengers in S.H.I.E.L.D's database using cutting-edge programming language
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!