7. Write a program that calculate the food ordering bill for a customer..
• In the main() function:
Declare all necessary variables.
Ask the user to enter their name and mobile number.
Next display the menu.
Ask the user to enter their prefered choice, 1 or 2.
Using a switch case statement, identify what needs to be done next based on the table below.
CHOICE TASK
1
• The menu name is “Chicken barbeque Pizza”.
• The menu price is RM15.50.
• Ask the user whether they want extra cheese.
• If they want extra cheese, the cost is RM3.50.
2
• The menu name is “Spring Roll”.
• The menu price is RM6.90
• Ask the user whether they want spicy sauce.
• If they want spice sauce, the cost is RM1.50.
Ask the user if they need delivery. Delivery cost is RM10.00.
Calculate the entire bill and display all the information as shown below.
Comments
Leave a comment