Note: I developed the code in c++ .If u want me to change into ‘C’ or ‘Java ‘ i can modify.Thank You.
Don't use plagiarized sources. Get Your Custom Essay on
(Solved Homework): Write a program that displays a simple restaurant menu, then asks the user to enter the number corresponding to a choice on the menu…
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT!
_______________
#include <iostream>
using namespace std;
int main()
{
// Declaring variables
int choice;
int orders;
/* This while loop continues to execute
* until the user enters a valid number
*/
while (true)
{
// Displaying the menu
cout << “——————————-” << endl;
cout << “Available menu at Monty Python” << endl;
cout << “——————————-” << endl;
cout << “1. Soup and Salad” << endl;
cout << “2. Pasta with meat balls” << endl;
cout << “3. Philly cheese-steak” << endl;
// getting the choice entered by the user
cout << “Please enter a menu choice using a number:”;
cin >> choice;
// based on the user choice the corresponding case will be executed
switch (choice)
{
case 1:
{
cout << “Please enter the no of orders:”;
cin >> orders;
if (orders == 1)
{
cout << “One ”
“”Soup and salad””
“coming right up !”
<< endl;
}
else if (orders == 2)
{
cout << “Two ”
“”Soup and salad””
“coming right up !”
<< endl;
}
else
{
cout << “You entered Invalid no of Orders .” << endl;
continue;
}
break;
}
case 2:
{
cout << “Please enter the no of orders:”;
cin >> orders;
if (orders == 1)
{
cout << “One ”
“”Pasta with meat balls””
” coming right up !”
<< endl;
}
else if (orders == 2)
{
cout << “Two ”
“”Pasta with meat balls””
“coming right up !”
<< endl;
}
else if (orders == 3)
{
cout << “Three ”
“”Pasta with meat balls””
“coming right up !”
<< endl;
}
else
{
cout << “You entered Invalid no of Orders .” << endl;
continue;
}
break;
}
case 3:
{
if (orders == 1)
{
cout << “One ”
“”Philly cheese-steak””
” coming right up !”
<< endl;
}
else if (orders == 2)
{
cout << “Two ”
“”Philly cheese-steak””
“coming right up !”
<< endl;
}
else if (orders == 3)
{
cout << “Three ”
“”Philly cheese-steak””
“coming right up !”
<< endl;
}
else if (orders == 4)
{
cout << “Four ”
“”Philly cheese-steak””
” coming right up !”
<< endl;
}
else if (orders == 5)
{
cout << “Five ”
“”Philly cheese-steak””
” coming right up !”
<< endl;
}
break;
}
default:
{
cout << “** Invalid Choice **” << endl;
continue;
}
}
break;
}
return 0;
}
___________________
Output:

_______