Assignment #3 - Using a While Loop and if/else statement
A pizza store is having a special on pizzas. $5 a pizza pie, limit 4 per customer.
The person working behind the counter enters in the amount of pies
that a person wants to get. A person can get either, 1, 2, 3,
or 4 pizza pies. At the end of the day, the worker enters in -1
(negative 1), as the number of pies, to indicate to the
program that the program is done taking orders for the day. When the
program is done taking orders, display the total number of pies orders,
and the amount of money the pies were in total.
- Have a greeting message.
- Display a prompt that asks the worker to enter in the number of
pies (show the range of pies allowed, and show what to enter to there
are no more orders to be entered).
- Test that the number of pies is in the correct range. If a
value is incorrect, do not process that order, instead indicate an
error.
- For a valid order, display the number of pies that the person
ordered and calculate the total price. You must use correct spelling,
either pies or pie, depending on the quantity.
- When the worker enters in -1, DO NOT say -1 pies ordered. Display
the total number of pies orders, and the total amount of money for the
pies. You must use correct spelling, either pies or pie, depending on
the quantity. If no one ordered any pies, remember the spelling is "0
pies". Test that it works properly.
- After the displaying the amount of pies and money, display a
goodbye message.
Testing the program: Test your program with the following inputs and
print out the results. You will need to run the program 5 times.
- -1
- 0 -1
- 1 -1
- 8 2 5 -2 -1
- 1 2 3 4 -1