Write a C program that calculates the price of a pizza and prints the receipt as follows: 1- Your program should first ask the user to enter the size of the pizza (integer value 1=large, 2=medium, 3=small) as well as the number of toppings (integer). 2- Your program should then read the pizza basic price (double) as well as the price of a topping ( float ) from the user. 3- Your program should then calculate the total price of the pizza using the following formula: Total price = ( basic price + number of toppings * topping price ) / size; And print a receipt which displays the details of your pizza order as well as the final total price to the screen

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.3: Nested If Statements
Problem 7E
icon
Related questions
icon
Concept explainers
Question

Write a C program that calculates the price of a pizza and prints the receipt as follows:

1- Your program should first ask the user to enter the size of the pizza (integer value 1=large, 2=medium, 3=small) as well as the number of toppings (integer).

2- Your program should then read the pizza basic price (double) as well as the price of a topping ( float ) from the user.

3- Your program should then calculate the total price of the pizza using the following formula: Total price = ( basic price + number of toppings * topping price ) / size; And print a receipt which displays the details of your pizza order as well as the final total price to the screen

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,