Question: Question 1 marks ] You are tasked with creating a simple menu - driven program for a fast - food restaurant. The program should allow
Question
marks
You are tasked with creating a simple menudriven program for a fastfood restaurant. The program should allow the user to order food items by selecting options from a menu using a switch statement. The user can continue ordering items until they decide to exit the program.
Requirements:
Display a menu with the following options:
Burger R
Pizza R
Fries R
Soda R
Exit
Required:
a Implement a recursive function that repeatedly displays the menu, takes the user's order, and calculates the total cost until they choose to exit.
b Use a switch statement within the recursive function to process the user's choice:
For options display a message indicating the item ordered and its price.
For option Exit display a thank you message and exit the recursion.
Calculate and display the total cost of the user's order.
Your recursive function should guide the user through the ordering process and provide the total cost when they choose to exit.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
