Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We are going to use psuedocode to code an application used to purchase pizza. This program will assess your ability to get input and print

We are going to use psuedocode to code an application used to purchase pizza. This program will assess your ability to
get input and print output, use loops and decision structures, and perform basic calculations. (The exam covers Chapters
1-4). Please ensure you include your IPO chart.
To start, display a welcome message: Welcome to Pizza Planet!
You will prompt the user to enter their name.
You will then ask the user how many pizzas they would like to order (1-10)
A while loop will be used, to validate the number of pizzas is between 1-10. If the user inputs a number less than zero or
greater than 10 the following error message will display.
Invalid Input. You must order between 1 and 10 pizzas
Once you get a valid number for the number of pizzas ordered you will continue with the program
Let the user know if they purchase four or more pizzas, they will receive a 15% discount on their total order.
If you order 4 or more pizzas, you'll receive a discount of 15%.
Assume the pizza sizes are the same for everyone.
Menu shown below:
Enter C for Cheese
Enter P for Pepperoni
Enter S for Supreme
Enter V for Veggie
With a while loop, validate the pizza codes to ensure that they are either C, P, S, or V. If they choose any other option
than C, P, S, or V display a message like the one below and allow them to input the pizza choices again:
Welcome to Pizza Planet
Enter your full name
Bob
How many pizzas would you like to order? If you order 4 or more pizzas,
you'll receive a discount of 15%. You must order between 1 and 10 pizzas
2
Please enter the type of pizza that you want to order:
Enter C for Cheese
Enter P for Pepperoni
Enter S for Supreme
Enter V for Veggie
Enter selection for pizza #1
d
Incorrect Pizza Option. Please Try Again for Pizza #1.
c
Enter selection for pizza #2
p
Here is your order confirmation
Name Bob
Number of Pizzas Purchased 2
Discount 0.00
Subtotal 17.60
Grand Total 17.60
When a user adds a pizza to their order, count the pizzas and have a running total.
Welcome to Pizza Planet!
Enter your name
Bob
How many pizzas would you like to order? If you order 4 or more pizzas,
you'll receive a discount of 15%. You must order between 1 and 10 pizzas
0
Invalid Input. You must order between 1 and 10 pizzas
11
Invalid Input. You must order between 1 and 10 pizzas
3
Please enter the type of pizza that you want to order:
Enter C for Cheese
Enter P for Pepperoni
Enter S for Supreme
Enter V for Veggie
Enter selection for pizza #1
C
Here is your order confirmation
Name Bob
Number of Pizzas Purchased 3
Discount 0.0
Subtotal 8.00
Grand Total 8.00
Enter selection for pizza #2
P
Here is your order confirmation
Name Bob
Number of Pizzas Purchased 3
Discount 0.0
Subtotal 17.60
Grand Total 17.60
Enter selection for pizza #3
P
Here is your order confirmation
Name Bob
Number of Pizzas Purchased 3
Discount 0.0
Subtotal 27.20
Grand Total 27.20
Welcome to Pizza Planet!
Enter your name
Sarah
How many pizzas would you like to order? If you order 4 or more pizzas,
you'll receive a discount of 15%. You must order between 1 and 10 pizzas
4
Please enter the type of pizza that you want to order:
Enter C for Cheese
Enter P for Pepperoni
Enter S for Supreme
Enter V for Veggie
Enter selection for pizza #1
C
Here is your order confirmation
Name Sarah
Number of Pizzas Purchased 4
Discount 0.15
Subtotal 8.00
Grand Total 6.80
Enter selection for pizza #2
p
Here is your order confirmation
Name Sarah
Number of Pizzas Purchased 4
Discount 0.15
Subtotal 17.60
Grand Total 14.96
Enter selection for pizza #3
s
Here is your order confirmation
Name Sarah
Number of Pizzas Purchased 4
Discount 0.15
Subtotal 29.10
Grand Total 24.74
Enter selection for pizza #4
v
Here is your order confirmation
Name Sarah
Number of Pizzas Purchased 4
Discount 0.15
Subtotal 41.10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Define customer relationship management.

Answered: 1 week ago