Question
The code snippet below is part of the restaurant menu program you previously used in the lab. Add a choice for a drink. Add the
The code snippet below is part of the restaurant menu program you previously used in the lab. Add a choice for a drink. Add the necessary code to allow the program to calculate the total price of order for the user. Assume the following price list: Hamburger $5 Hotdog $4 Fries $3 Drink $2 The program should allow the user to keep entering order until choosing to exit. At the end the program prints an order summary like this: You ordered 2 hamburger(s), 1 hotdog(s), 3 fries, 0 drink(s). Price: $23 HST: $2.99 Total: $25.99
do { printf("What do you want to eat today? "); printf("1. Hamburger "); printf("2. Hotdog "); printf("3. Fries "); printf("4. Exit "); printf("Enter your choice: "); scanf("%d", &choice); switch(choice){ case 1: printf("You ordered a hamburger "); break; case 2: printf("You ordered a hotdog "); break; case 3: printf("You ordered fries "); break; case 4: printf("Order finished, thank you! "); break; default: printf("Wrong choice! try again: "); } } while (choice != 4);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started