The restaurant menu system program is a simple program that can be created using C++ programming language. In this program, we will use the switch case statement, which is a useful control statement that allows us to choose between different options based on the input provided by the user.
The program will start by displaying a menu with different options, such as viewing the menu, placing an order, viewing the total bill, and exiting the program. The user can choose any option by entering the corresponding number.
If the user chooses to view the menu, the program will display a list of available items with their prices. The user can then choose to place an order by entering the item number and the quantity they want to order. The program will keep track of the items ordered and their quantities.
Once the user is done ordering, they can choose to view the total bill, which will display the items ordered with their quantities and prices, as well as the total bill amount.
Finally, the user can choose to exit the program. The program will display a message thanking the user for visiting the restaurant.
Overall, this program is a simple but useful example of how C++ can be used to create practical programs for everyday use.
In this program:
- Menu items
- Prices
- Quantity of order
A simple example of this application:
When a customer comes and checks out the restaurant menu in the menu he sees their item number, price, and the number of items then he orders an item, for example, he orders a pizza that number 2 and the price of ₹ 159/-, select only one pizza.
Source code is here.
#include <iostream>
using namespace std;
int main()
{ int order, no_items;
cout<<endl<<endl<<" ....Punjabi Dhaba...." <<endl<<endl;
cout<<"..............Restaurant Menu.............."<<endl<<endl;
// menu card
cout<<" 1. Dal Makhani - ₹ 139/-"<<endl;
cout<<" 2. Butter Naan - ₹ 19/-"<<endl;
cout<<" 3. Shahi Paneer - ₹ 159/-"<<endl;
cout<<" 4. Sweet Lassi - ₹ 79/-"<<endl;
cout<<" 5. Coffee - ₹ 59/-"<<endl<<endl;
// order from customer
cout<<" Please select the order number: ";
cin>>order;
cout<<endl;
// quantity of order
cout<<" Please enter the quantity of order: ";
cin>>no_items;
cout<<endl;
//switch case statement
switch(order){
case 1:
cout<<" Your Order"<<endl;
cout<<" Order: Dal Makhani"<<endl;
cout<<" Quantity of order: "<<no_items<<endl;
cout<<" Price of each item: ₹ 139/- Only"<<endl;
cout<<" Total Amount: ₹ "<<139*no_items<<"/- Only"<<endl<<endl;
cout<<"...........Thank You For Coming..........."<<endl;
cout<<" ...........Have a good day..........."<<endl;
break;
case 2:
cout<<" Your Order"<<endl;
cout<<" Order: Butter Naan"<<endl;
cout<<" Quantity of order: "<<no_items<<endl;
cout<<" Price of each item: ₹ 19/- Only"<<endl;
cout<<" Total Amount: ₹ "<<19*no_items<<"/- Only"<<endl<<endl;
cout<<"...........Thank You For Coming..........."<<endl;
cout<<" ...........Have a good day..........."<<endl;
break;
case 3:
cout<<" Your Order"<<endl;
cout<<" Order: Shahi Paneer"<<endl;
cout<<" Quantity of order: "<<no_items<<endl;
cout<<" Price of each item: ₹ 159/- Only"<<endl;
cout<<" Total Amount: ₹ "<<159*no_items<<"/- Only"<<endl<<endl;
cout<<"...........Thank You For Coming..........."<<endl;
cout<<" ...........Have a good day..........."<<endl;
break;
case 4:
cout<<" Your Order"<<endl;
cout<<" Order: Sweete Lassi"<<endl;
cout<<" Quantity of order: "<<no_items<<endl;
cout<<" Price of each item: ₹ 79/- Only"<<endl;
cout<<" Total Amount: ₹ "<<79*no_items<<"/- Only"<<endl<<endl;
cout<<"...........Thank You For Coming..........."<<endl;
cout<<" ...........Have a good day..........."<<endl;
break;
case 5:
cout<<" Your Order"<<endl;
cout<<" Order: Coffee"<<endl;
cout<<" Quantity of order: "<<no_items<<endl;
cout<<" Price of each item: ₹ 59/- Only"<<endl;
cout<<" Total Amount: ₹ "<<59*no_items<<"/- Only"<<endl<<endl;
cout<<"...........Thank You For Coming..........."<<endl;
cout<<" ...........Have a good day..........."<<endl;
break;
}
return 0;
}
Output:
![]() |
Screenshot by Author |
0 Comments