Question

In: Computer Science

Create a program that will ask the user to choose their order from a simple menu....

Create a program that will ask the user to choose their order from a simple menu. Customers first choose from three types of dishes: Sandwiches/wraps, Rice Meals, or Noodles. They can type in 1, 2, or 3 to select the type then, they choose a specific dish as shown below. Confirm their order by displaying it on the screen after they make their selection. 1. Sandwiches/wraps Hamburger Chicken shawarma 2. Rice meals Arroz con pollo Chana masala 3. Noodles Chow mein Pasta al pomodoro Which variation of the if statement would best fit the requirements (if, if-else, if-else-if chain, nested if)? Create the complete C++ program.

Solutions

Expert Solution

Thanks for the question.


Below is the code you will be needing Let me know if you have any doubts or if you need anything to change.


Thank You !!

The best fit for the requirement is using if else statement as illustrated in the code.


===========================================================================

#include <iostream>
using namespace std;


int main(){
  
  
   int userChoice=0;
  
       cout<<"Type [1] for Sandwiches/Wraps"<<endl
       <<"Type [2] for Rice Meals"<<endl
       <<"Type [3] for Noodles"<<endl
       <<"Enter your choice here: ";
      
       cin>>userChoice;
      
       if(userChoice==1){
           cout<<"Order confirmed. Your order: Sandwiches/wraps Hamburger Chicken shawarma ";
           cout<<endl;
       }else if(userChoice==2){
           cout<<"Order confirmed. Your order: Rice meals Arroz con pollo Chana masala ";
           cout<<endl;
       }else if(userChoice==3){
           cout<<"Order confirmed. Your order: Noodles Chow mein Pasta al pomodoro ";
           cout<<endl;
       }else{
           cout<<"Sorry! Your selection is invalid"<<endl;
       }
      
}

thank you so much. Please do give a thumbs up : )


Related Solutions

print a menu so that the user can then order from that menu. The user will...
print a menu so that the user can then order from that menu. The user will enter each item they want until they are done with the order. At the end you will print the items the user ordered with their price and the total. Note: You will be storing your menu items (pizza, burger, hotdog, salad) and your prices (10, 7, 4, 8) in separate lists. Menu 0) pizza $10 1) burger $7 2) hotdog $4 3) salad $8...
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will...
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will first enter a password, then enters the same password again; If the second input is the same as first one, the user successfully creates the password. Print “Well done.”; Otherwise, the user will be directed to repeat the whole process (go to step 1.)
Introduction to Java Programing Using Loop Create a simple calculator program using loop Ask user to...
Introduction to Java Programing Using Loop Create a simple calculator program using loop Ask user to input two numbers using scanner class Print the instruction of the menu for the calculator program Ask user to press 0 to Quit Ask user to press 1 to Add Ask user to press 2 to Substract Ask user to press 3 to Multiply Ask user to press 4 to Divide Perform correct calcuation based on user inputs and print the result Print error...
Write a C++ program that allows a user choose item to purchase from a list; ask...
Write a C++ program that allows a user choose item to purchase from a list; ask for the amount to calculate the cost of the purchase; offer to add a tip; add a delivery fee based on the subtotal; then calculate the total amount that the user needs to pay. ---------------------------------- ----- GROCERY SHOPPING ITEMS ----- Milk     - $5.99 / gallon Egg      - $6.99 / dozen Cheese   – $10.98 / 8oz Pasta    – $2.75 / packet ---------------------------------- Other Values to...
Create a small program that contains the following. ask the user to input their name ask...
Create a small program that contains the following. ask the user to input their name ask the user to input three numbers check if their first number is between their second and third numbers
Create a menu-based program that will allow the user to calculate the area for a few...
Create a menu-based program that will allow the user to calculate the area for a few different shapes: square, rectangle, parallelogram, and circle. Refer to the Sample Output in this document to see what menu options you should use. Create PI as a global constant variable. Main Function use do-while to repeat program until user chooses option 5 call the displayMenu function get user choice & validate with while loop depending on user’s choice, get the data required to calculate...
Create a menu-based program that will allow the user to calculate the area for a few...
Create a menu-based program that will allow the user to calculate the area for a few different shapes: square, rectangle, parallelogram, and circle. Refer to the Sample Output in this document to see what menu options you should use. Create PI as a global constant variable. Main Function use do-while to repeat program until user chooses option 5 call the displayMenu function get user choice & validate with while loop depending on user’s choice, get the data required to calculate...
C Program: Create a C program that prints a menu and takes user choices as input....
C Program: Create a C program that prints a menu and takes user choices as input. The user will make choices regarding different "geometric shapes" that will be printed to the screen. The specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Important! Consider which control structures will work best for which aspect of the assignment. For example, which would be the best to use for a menu?...
We need to create basic program that will simply display a menu and allow the user...
We need to create basic program that will simply display a menu and allow the user to select one of the choices. The menu should be displayed such that each option will be numbered, as well as have one capital letter so as to indicate that either the number or the designated letter can be entered to make their choice. Once the choice is made, the sub-menu for that selection should be displayed. Colors with an odd number of letters...
Create a C++ program that will ask the user for how many test scores will be...
Create a C++ program that will ask the user for how many test scores will be entered. Setup a while loop with this loop iteration parameter. (no fstream) The data needs to include the student’s first name, student number test score the fields should be displayed with a total width of 15. The prompt should be printed with a header in the file explaining what each is: ex. First Name student number Test Score 1) mike 6456464   98 2) phill...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT