A food court facilitates their customers with a featured App where the customers can view the Menu Card and place their order. The order may be delivered on-premises or off-premises as per policies. Write a code to take the order from the customer by pressing menu number & Quantity. Final Output should be the calculated total amount.

 A food  court facilitates their customers with a featured App where the customers can view the Menu Card and place their order. The order may be delivered on-premises or off-premises as per policies. Write a code to take the order from the customer by pressing menu number & Quantity. Final Output should be the calculated total amount. Menu card is given as:


OUTPUT FOR THE PROGRAM
Number Name                                         Price

1            Veg Sandwich                              80    

2            Cheese Sandwich                        130

            Veg Grilled Sandwich                100

4              Sada Dosa                                  80

5              Masala Dosa                              90

6              Onion Rava Sada Dosa              110

7              Onion Rava Masala Dosa           120

8              Spring Dosa                                 140

9               Plain Uttapam                              70

10             Onion Uttapam                             80



#include<iostream>

using namespace std;


int M,Q,Total;

string ans;

string Menu[]={"Veg Sandwich","Cheese Sandwich","Veg Grilled Sandwich","Sada Dosa","Masala Dosa","Onion Rava Sada Dosa","Onion Rava Masala Dosa","Spring Dosa","Plain Uttapam","Onion Uttapam"};

float Price[]={80.0,130.0,100.0,80.0,90.0,110.0,120.0,140.0,70.0,80.0};


void Display()

{

cout<<"Number\t"<<"Name\t\t\t\t"<<"Price\n";

for(int i=0;i!=10;i++)

{

cout<<i+1<<"\t"<<Menu[i]<<"\t\t\t"<<Price[i]<<"\n";

}

cout<<"\n";

}


void get()

{

cout<<"Enter Menu Number: ";

cin>>M;

cout<<"Enter Quantity: ";

cin>>Q;

}

int main()

{

Display();

do

{

get();

Total +=Price[M-1]*Q;

cout<<"Do you want to continue(y/n): ";

cin>>ans;

}

while(ans=="y");

cout<<"Total is: "<<Total<<"\n";

return 0;

}

/* ***********OUTPUT***************

Number  Name                                 Price

1       Veg Sandwich                            80

2       Cheese Sandwich                     130

3       Veg Grilled Sandwich              100       

4       Sada Dosa                                 80

5       Masala Dosa                             90

6       Onion Rava Sada Dosa           110         

7       Onion Rava Masala Dosa       120         

8       Spring Dosa                            140

9       Plain Uttapam                           70

10      Onion Uttapam                        80


Enter Menu Number: 1

Enter Quantity: 2

Do you want to continue(y/n): y

Enter Menu Number: 3

Enter Quantity: 2

Do you want to continue(y/n): n

Total is: 360


--------------------------------


For more such posts click the link:-http://svencrai.com/G8W

Comments

Popular posts from this blog

A book shop maintains the inventory of books that are being sold at the shop. The list includes details such as author, title, price, publisher and stock position. Whenever a customer wants a book, the sales person inputs the title and author and the system searches the list and displays whether it is available or not. If it is not, an appropriate message is displayed. If it is, then the system displays the book details and requests for the number of copies required. If the requested copies book details and requests for the number of copies required. If the requested copies are available, the total cost of the requested copies is displayed; otherwise the message ?Required copies not in stock? is displayed. Design a system using a class called books with suitable member functions and Constructors. Use new operator in constructors to allocate memory space required. Implement C++ program for the system

Imagine a publishing company which does marketing for book and audiocassette versions. Create a class publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int), and tape, which adds a playing time in minutes (type float). Write a program that instantiates the book and tape classes, allows user to enter data and displays the data members.

Write C++ program for storing appointment schedule for day. Appointments are booked randomly using linked list. Set start and end time and min and max duration for visit slot. Write functions for- a)Display free slots b)Book appointment c)Cancel appointment ( check validity, time bounds, availability etc) d)Sort list based on time e)Sort list based on time using pointer manipulation