subject

1. Write a function called OrderTotal that takes in four integer parameters representing the number of Krabby Patties, the number of drinks, the number of fries, and the number of pizzas in a customer's order. The function should return the total order cost based on the price of each item presented in the menu. NO user input or output to the screen should occur in this function. The function should simply calculate the order total based on the counts of each item and return this value as a double.
2. Write a function called menu that takes in no parameters and returns no value. This function is only responsible for printing the following menu to the screen:
Menu
1. Krabby Patty $3.50
2. Barnicle Fries $1.50
3. Kelp Shake $1.00
4. Krusty Krab Pizza . $5.00
3. To test these functions, and help facilitate your program, write a main() routine (in the same file) that enters a loop and starts by presenting the customer with the menu (by calling the appropriate function). Allow the customer to specify what they want off the menu. The customer should enter 1,2,3, or 4 to order an item or 0 to exit. If they enter any other value here (besides 0-->4) print an error message. If they enter a valid menu item, ask how many of that item they'd like to order. FORCE the user to enter a correct valid value here (0 or more is valid, negative amounts of items are not). See the sample runs below for more details.
4. When the customer is done ordering, print the counts of each item they ordered as well as their order total (by calling the appropriate function to help you calculate the order cost).
Sample Run 1:

(user input in [ ] )

Welcome to the Krusty Krab!

Menu
1. Krabby Patty $3.50
2. Barnicle Fries $1.50
3. Kelp Shake $1.00
4. Krusty Krab Pizza . $5.00

What would you like? (Enter 0 to finish order!): [2]
How many: [1]

Menu
1. Krabby Patty $3.50
2. Barnicle Fries $1.50
3. Kelp Shake $1.00
4. Krusty Krab Pizza . $5.00

What would you like? (Enter 0 to finish order!): [4]
How many: [1]

Menu
1. Krabby Patty $3.50
2. Barnicle Fries $1.50
3. Kelp Shake $1.00
4. Krusty Krab Pizza . $5.00

What would you like? (Enter 0 to finish order!): [0]

Your order:
1 barnacle fries.
1 krusty krab pizzas.

Your total is $6.50
Enjoy the food!

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 19:50, Aprillove7939
Which feature is selected to practice and save the timing of a presentation
Answers: 1
image
Computers and Technology, 24.06.2019 08:20, bob4059
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
image
Computers and Technology, 24.06.2019 12:30, nomood
Select all that apply. what two keys listed below should you use to enter data in an excel worksheet? tab backspace enter right arrow
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, toshahoskins0098
What are some websites that you can read manga (ex: manga rock)
Answers: 1
You know the right answer?
1. Write a function called OrderTotal that takes in four integer parameters representing the number...

Questions in other subjects:

Konu
Computers and Technology, 03.11.2020 01:00
Konu
Chemistry, 03.11.2020 01:00
Konu
History, 03.11.2020 01:10