Question

In: Computer Science

Use list/link list and write in C++ Food ordering system 1. Place Order 2. View the...

Use list/link list and write in C++

Food ordering system

1. Place Order
2. View the food details
3. Modify food details
4. Delete food details

5. Exit

Order should let the customer to enter the food code, flavor, weight(kg), unit price, qty, customer ID, name, address and contact number. It will also have an order id automatically assigned with a unique ID when new order is added. When view the food details, it should also calculate the unit price * qty as a bill amount. You should also be able to modify all the food details and delete food details.

Solutions

Expert Solution

// USERID= 1234, PASSWORD=pass
#include<iostream>
#include<string.h>
#include<conio.h>
#include<fstream>
#include<unistd.h>
#include<windows.h>
using namespace std;
class one
{    
public:
        void menu1();   
};
void one::menu1()
{
        
        cout<<"\n\n\n\t\t\t\t\t\t ========== WELCOME TO FOOD ORDERING SYSTEM =========="<<endl;
        cout<<"\n\n\t\t\t\t\t\t\t       =====START YOUR ORDER====="<<endl;
        cout<<"\n\n\n\t===========================\t\t\t==========================\t\t\t\t==========================="<<endl;
        cout<<"\t[1] Veggie Supreme (Rs.480)\t\t\t[2] Exotica Pizza(Rs.440)\t\t\t\t[3] Chicken Sizzler (Rs.580)\n";
        cout<<"\t[4] Chrispy Chicken (Rs.520)\t\t\t[5] Spaghetti (Rs.350)\t\t\t\t\t[6] Country Feast (Rs.400)\n";
        cout<<"\t[7] Tetrazzini (Rs.420)\t\t\t\t[8] Double Cheese (Rs.540)\t\t\t\t[9] Makizushi (Rs.548)\n";
        cout<<"\t[10] Ham Burger (Rs.390)\t\t\t[11] Margherita Pizza(Rs.525)\t\t\t\t[12] Fish 'n' Chips (Rs.425)\n";
        cout<<"\t[13] Fajitas (Rs.335)\t\t\t\t[14] Tempura (Rs.324)\t\t\t\t\t[15] Hot Dog (Rs.360)\n\t===========================\t\t\t==============================\t\t\t\t===========================\n\n\n\t\t\t\t\t\t\t\t[16] EXIT"<<endl;
        cout<<"\n\t======================================================================================================================================="<<endl;
}

class two:public one
{
protected:
        int  pizza,ch,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s=0;
    string y,ye;
public:
        void menu2()
        {    
                ofstream write;
                write.open("order.text");
                if(!write)
                {
                        cout<<"file can not open"<<endl;
                        exit (-1);
                }
        
                a:
                        b:
                                c:
                                cout<<"\n\n\tENTER YOUR ORDER (one order at a time): "; 
                        cin>>ch;
                        cout<<"\n\n\tDO YOU WANT TO CHANGE YOUR ORDER (y/n) :";
                                cin>>ye;
         
                                if(ye=="y"|| ye=="Y")
                                {
                                        cout<<"\n\n''''Previous item was not added''''";
                                        goto c;
                                }
                                else
                                {
                                        switch(ch)
                                        {
                                                case 1:
                                                                cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";
                                                                cin>>pizza;
                                                                a=480;
                                                                s=s+a*pizza;
                                                                write<<"YOU ORDER  Veggie Supreme : 480";
                                                                write<<" \n";
                                                                write<<"NUMBER OF PIZZA IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Veggie Supreme "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                
                                                case 2:
                                                                cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";
                                                                cin>>pizza;
                                                                b=440;
                                                                s=s+b*pizza;
                                                                write<<"YOU ORDER  Exotica : 440";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF PIZZA IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Exotica "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                
                                                case 3:
                                                                cout<<"\n\n\tHOW MANY CHICKEN SIZZLER YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                c=580;
                                                                s=s+c*pizza;
                                                                        write<<"YOU ORDER  Chicken Sizzler : 580";
                                                                        write<<" \n";
                                                                                write<<"NUMBER OF Chicken Sizzler IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Chicken Sizzler "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 4:
                                                                cout<<"\n\n\tHOW MANY CHRISPY CHICKEN YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                d=520;
                                                                s=s+d*pizza;
                                                                write<<"YOU ORDER  Chrispy Chicken : 520";
                                                                write<<" \n";
                                                                write<<"NUMBER OF Chrispy Chicken IS : "<<pizza;
                                                                write<<"\n";
                                                           cout<<"\n\n\n\tYOU ORDER  Chrispy Chicken "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 5:
                                                                cout<<"\n\n\tHOW MANY SPAGHETTI YOU WANT:";
                                                                cin>>pizza;
                                                        
                                                                e=350;
                                                                s=s+e*pizza;
                                                                write<<"YOU ORDER  Spaghetti : 350";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF Spaghetti IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Spaghetti "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 6:
                                                                cout<<"\n\n\tHOW MANY PIZZA YOU WANT:";
                                                                cin>>pizza;
                                                        
                                                                f=400;
                                                                s=s+f*pizza;
                                                                write<<"YOU ORDER Country Feast : 400";
                                                                write<<"\n ";
                                                                        write<<"NUMBER OF PIZZA IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER Country Feast "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 7:
                                                                cout<<"\n\n\tHOW MANY TETRAZZINI YOU WANT:";
                                                                cin>>pizza;
                                                        
                                                                g=420;
                                                                s=s+g*pizza;
                                                                write<<"YOU ORDER Tetrazzini : 420";
                                                                write<<"\n ";
                                                                        write<<"NUMBER OF Tetrazzini IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Tetrazzini "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 8:
                                                                cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                h=540;
                                                                s=s+h*pizza;
                                                                write<<"YOU ORDER Double Cheese : 540";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF PIZZA IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER   Double Cheese "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                
                                                case 9:
                                                                cout<<"\n\n\tHOW MANY MAKIZUSHI YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                i=548;
                                                                s=s+i*pizza;
                                                                write<<"YOU ORDER Makizushi : 548";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF Makizushi IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER Makizushi "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 10:
                                                                cout<<"\n\n\tHOW MANY HAM BURGER YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                j=390;
                                                                s=s+j*pizza;
                                                                write<<"YOU ORDER Ham Burger : 390";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF Ham Burger IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER Ham Burger "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 11:
                                                                cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                k=525;
                                                                s=s+k*pizza;
                                                                write<<"YOU ORDER Margherita : 525";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF PIZZA IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER   Margherita "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 12:
                                                                cout<<"\n\n\tHOW MANY FISH 'n' CHIPS YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                l=425;
                                                                s=s+l*pizza;
                                                                write<<"YOU ORDER Fish 'n' Chips : 425";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF Fish 'n' Chips IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Fish 'n' Chips "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 13:
                                                                cout<<"\n\n\tHOW MANY FAJITAS YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                m=335;
                                                                s=s+m*pizza;
                                                                write<<"YOU ORDER  Fajitas  : 335";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF Fajitas IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER Fajitas "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 14:
                                                                cout<<"\n\n\tHOW MANY TEMPURA YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                n=324;
                                                                s=s+n*pizza;
                                                                write<<"YOU ORDER Tempura : 324";
                                                                write<<" \n";
                                                                        write<<"NUMBER OF Tempura IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Tempura "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 15:
                                                                cout<<"\n\n\tHOW MANY HOT DOG YOU WANT :";
                                                                cin>>pizza;
                                                        
                                                                o=360;
                                                                s=s+o*pizza; //fn1353
                                                                write<<"YOU ORDER  Hot Dog : 360";
                                                                write<<"\n ";
                                                                        write<<"NUMBER OF Hot Dog IS : "<<pizza;
                                                                write<<"\n";
                                                                cout<<"\n\n\n\tYOU ORDER  Hot Dog "<<endl<<"\tYOUR ORDER SUCCESSFULLY SAVED "<<endl;
                                                                break;
                                                        
                                                case 16:
                                                                cout<<"\n\t\t\t\t\t Thankyou!!";
                                                                exit(0);
                                                                break;
                                                        
                                                default:
                                                                cout<<"\n\n\t\t\t\t\t\t\tYOU ENTER WRONG ORDER KEY !!!!! "<<endl;
                                                                goto c;
                                                                break;
                                        }
                                        cout<<"\n\tDO YOU WANT ANOTHER ORDER (y/n) :";
                                        cin>>y;
                                        if(y=="y"|| y=="Y")
                                        {
                                                goto c;
                                        }
                                    else
                                    {
                                                cout<<"\n\t\t\t\t\t\t\tTHANK YOU FOR YOUR ORDER :) GENERATING BILL ";
                                                for(int a=1;a<8;a++) // Change 'a<?' to how many * you want
                                                {
                                                        Sleep(500);
                                                        cout << "...";
                                                }
                                                cout<<"\n\t\t\t\t\t\t\t";
                                                system("PAUSE");
                                    }
                                }
                                system("cls");
                                cout << "\n\t\t\t\t\t\t\t ================================================"<<endl;
                                cout << "\t\t\t\t\t\t\t|               Food Ordering System             |"<<endl;
                                cout << "\t\t\t\t\t\t\t ================================================"<<endl;
                                cout << endl;
                                cout << endl;
        
                                cout << "\t\t\t\t\t\t\t  Bill No : CP51           Order : NB1353"<<endl;
                                cout << "\n\n\t\t\t\t\t\t\t  Cashier :  Harry"<<endl;
                                cout << endl;
                    cout<<"\t\t\t\t\t\t\t\t    YOUR TOTAL BILL IS Rs."<<s<<endl;
                    write<<"\t\t\t\t\t\t\t ";
                        write<<"\t\t\t\t\t\t\tTOTAL BILL IS : "<<s;
                                cout << "\n\t\t\t\t\t\t\t ================================================"<<endl;
        
                write.close();
        }
        
        void show1()
        {
                menu1();
                menu2();
        }
};

class three:public one,public two
{
        public:
                void total()
      {
                long userId; //for user id of administrator
                string name;
                        d:      
                        cout<<"\n\n\n\n\n\n\t\t\t\t\t\t\t---------------------";
                        cout<<"\n\t\t\t\t\t\t\tEnter a four digit Login Id = ";
                        cin>>userId;
                        cout<<"\t\t\t\t\t\t\t---------------------";
                        if(userId!=1234)  
                        {
                                cout<<"\nPlease Enter correct id\n";
                                goto d;
                        }
                        else
                        cout<<"\n\n\n\t\t\t\t\t\t\tHello Rajan,\n";
                        z:
                        string pwd="pass";  //password
                        string pass="";  //empty string
                        char c; 
                                cout<<"\n\n\n\t\t\t\t\t\t\tPassword = "; 
                                p:
                                c=getch();
                                cout<<"*";   //for printing * instead for password
                                if(c!=13)
                                {
                                        pass=pass+c;  //for concatenating the string
                                        goto p;
                                }   
                                        
                        {
                        if(pass==pwd)
                        {
                                cout<<"\n\n\t\t\t\t\t\t\tAccess Granted. Welcome to our system\n\n\n";
                                system("PAUSE");
                                system("CLS");
                                show1();
                                }
                                else
                                {
                                cout<<"\nWrong Password\n";
                                goto z;
                                }
                        }
                }
};
int main()
{   
   three ob;
   ob.total();
   getch();
}

Note:

USER ID = 1234

PASSWORD = pass

PLEASE RUN THIS ON FULL SCREEN FOR BETTER EXPERIENCE.

Hope this will help!

Good Luck!


Related Solutions

Use linked list and write in C++ Food ordering system 1. Place Order 2. View the...
Use linked list and write in C++ Food ordering system 1. Place Order 2. View the food details 3. Modify food details 4. Delete food details Order should let the customer to enter the food code, flavor, weight(kg), unit price, qty, customerID, name, address and contact number. It will also have an order id automatically assigned with a unique ID when new order is added. When view the food details, it should also calculate the unit price * qty as...
Use linked list and write in C++ Food ordering system 1. Place Order 2. View the...
Use linked list and write in C++ Food ordering system 1. Place Order 2. View the food details 3. Modify food details 4. Delete food details Order should let the customer to enter the food code, flavor, weight(kg), unit price, qty, customerID, name, address and contact number. It will also have an order id automatically assigned with a unique ID when new order is added. When view the food details, it should also calculate the unit price * qty as...
Write in C++ code A system that allow users to place an order for the food,...
Write in C++ code A system that allow users to place an order for the food, view all the food details, modify or delete the food details. Design using objected oriented programming and list/link-list. Food order information contain : OrderID(auto assigned,unique), Food Code, flavor , weight, unit price, qty and customer information such as id, name, address and contact number. order ID shall be automatically assigned with a unique ID when new order is added. When viewing food details, it...
make sure to answer it completely and concisely. Use the following link in order to view...
make sure to answer it completely and concisely. Use the following link in order to view the Fed's most recent Beige Book ( a pdf version is available in the right hand menu). http://www.federalreserve.gov/monetarypolicy/beigebook/files/Beigebook_20151014.pdf What is the current macroeconomic situation in the U.S.? What should the Fed do about it? What monetary policy tools should the Fed use to achieve the result(s) you just recommended?
Q- Below is a project requirement for Online ordering system for fast food restaurant(where customer order...
Q- Below is a project requirement for Online ordering system for fast food restaurant(where customer order through app/online) Object-oriented design project: Table of Contents 1- Introduction; 2- Project Plan; 3- Functional Specifications (including descriptions of Actors/Roles; Business Rules; 3.1- Use-Case Diagrams with Use-Case descriptions; Examples of Class Diagrams (related to particular Use Cases); 3.2- Examples of Object Diagrams [related to the selected Class Diagrams]; 3.3- Examples of Sequence Diagrams; 3.4- Examples of Collaboration or Communication Diagrams; 3.5- Examples of State-Chart...
Please use C language and use link list to do this program. This program should ask...
Please use C language and use link list to do this program. This program should ask user to enter two fraction polynomials. Then user chocie if he want add it or multiple it. I need you please to test it to see if it work with these two fraction polynomials 1-  Left Poly Pointer: 1/1x2 + 3/4x + 5/12 2-Right Poly Pointer: 1/1x4 – 3/7x2 + 4/9x + 2/11 AND AFTER ADDING 3- Resulting Poly Pointer: 1/1x4 + 4/7x2 + 43/36x...
Place H2O, CH4, H2, and HBr in order of increasing boiling point and explain ordering in...
Place H2O, CH4, H2, and HBr in order of increasing boiling point and explain ordering in terms of intermolecular forces/bonding and what intermolecular forces each contains.
Write a C++ program to read in a list of 10 integers from the keyboard. Place...
Write a C++ program to read in a list of 10 integers from the keyboard. Place the even numbers into an array called even, the odd numbers into an array called odd, and the negative numbers into an array called negative. Keep track of the number of values read into each array. Print all three arrays after all the numbers have been read. Print only the valid elements (elements that have been assigned a value). a. Use main( ) as...
Please use C++ and linked list to solve this problem Linked list 1 -> 2 ->...
Please use C++ and linked list to solve this problem Linked list 1 -> 2 -> 3 -> 4 -> 5-> 6 ->7 replaceNode( 5 , 6) // Replace 5 with 6     result 1 -> 2 -> 3 -> 4 -> 6 -> 6 ->7 Base code #include <iostream> using namespace std; class Node { public:     int data;     Node *next;     Node(int da = 0, Node *p = NULL) {         this->data = da;         this->next =...
Write a Java Program to place a pizza ordering program. It creates a pizza ordered to...
Write a Java Program to place a pizza ordering program. It creates a pizza ordered to the specifications that the user desires. It walks the user through ordering, giving the user choices, which the program then uses to decide how to make the pizza and how much the cost of the pizza will be. Note: Use dialog boxes for communicating with the user. Remember to use the JOptionPane class which is the graphical user interface (GUI) and Comments that are...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT