Answer to Question #162895 in C++ for manoj

Question #162895

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


1
Expert's answer
2021-02-11T04:21:49-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment