write a program to order a food item from the menu card available in a hotel
sample output:
list of items:
item price
1.idly 10
2.dosa 30
3.poori 40
4.pongal 50
enter the choice: 2
enter the quantity: 3
total amount 90
#include <iostream>
using namespace std;
int main(){
int choice,q;
cout<<"1 Idly 10\n2.Dosa 30\n3.Poori 40\n4.Pongal 50\n Enter choice as a number from menu above"<<endl;
cin>>choice;
cout<<"Enter quantity"<<endl;
cin>>q;
switch(choice){
case 1:cout<<"total amount="<<10*q<<endl;
break;
case 2:cout<<"total amount="<<30*q<<endl;
break;
case 3:cout<<"total amount="<<40*q<<endl;
break;
case 4:cout<<"total amount="<<50*q<<endl;
break;
}
return 0;
}
Comments
Leave a comment