Thread: Basic Order booking program for a Restaurant ....

  1. #1
    Registered User
    Join Date
    Feb 2014
    Posts
    12

    Basic Order booking program for a Restaurant ....

    Hello again ....

    I have written a Basic program of an assignment on "Functions" related to a Restaurant Order Booking system.

    I am facing following two problems in it :

    1- I want to clear screen every time after a user's input so that the Screen related to User's input only show. What should I do to perform it?

    2- While selecting Zero (0) to jump back to Main Menu from Sub-Menu, the program works perfect. But after selecting Sub-Menu Card option, the program only shows the Input Option and not reflecting complete Sub-Menu Card option before it. I couldn't understand what I am lacking here ..... !

    I am providing the Program Code below and would be thankful if anyone of you point-out the missing error to run the program correctly.

    Code:
    #include <iostream>
    
    
    using namespace std;
    
    
    char mainmenucard (void);
    char chinesecuisine(void);
    char barbq(void);
    char pakistanicuisine(void);
    char beverages(void);
    
    
    char aboveline(void);
    char belowline(void);
    char nextline(void);
    
    
    char tabulation2(void);
    
    
    
    
    int main()
    {
        int mainmenu;
        mainmenu = (1,2,3,4);
    
    
        int submenu;
        submenu = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18);
    
    
        int friedrice = 0;
        int chickenshashlik = 0;
        int thaisoup = 0;
        int noodles = 0;
        int snacks = 0;
        int chickentikka = 0;
        int katakut = 0;
        int rashmikabab = 0;
        int chickenkerhai = 0;
        int biryani = 0;
        int quorma = 0;
        int nan = 0;
        int taftan = 0;
        int coke = 0;
        int sevenup = 0;
        int coffee = 0;
        int tea = 0;
    
    
              aboveline();
              nextline(); nextline(); nextline();
    
    
              cout << '\t' << "    " << "!.....  WELCOME TO THE DELICIOUS FOODS RESTAURANT .....!";
              nextline();
    
    
              mainmenucard();
              cin >> mainmenu;
              nextline(); nextline();
    
    
           while (0);
           {
                if ( mainmenu < 1 || mainmenu > 4 )
                {
                    cout << tabulation2() << "PLEASE INPUT YOUR OPTION FROM MAIN MENU \n"; nextline();
                    cout << tabulation2() << "1, 2, 3 OR 4 TO CHECK SUB MENU CARD: ";
                    cin >> mainmenu;
                    cin.ignore();
                    nextline(); nextline();
                }
    
    
                if (mainmenu == 1 )
                {
                    chinesecuisine();
                }
    
    
                if (mainmenu == 2 )
                {
                    barbq();
                }
    
    
                if (mainmenu == 3 )
                {
                    pakistanicuisine();
                }
    
    
                if (mainmenu == 4 )
                {
                    beverages();
                }
    
    
           }
    
    
            while (1)
            {
                if (submenu == 0)
                {
                    mainmenucard();
                    cin >> mainmenu;
                    nextline(); nextline();
                }
    
    
                nextline();
                cout << '\t' << "PRESS ZERO ( 0 ) TO RETURN BACK TO MAIN MENU \n";
                nextline();
                cout << '\t' << "PRESS ( 18 ) TO EXIT AND PRINT YOUR ORDER \n";
                nextline();
                cout << '\t' << "PLEASE PLACE YOUR ORDER HERE : ";
                cin >> submenu;
                nextline(); nextline();
    
    
    
    
                if (submenu == 1 )
                {
                    friedrice++;
                }
    
    
                if (submenu == 2 )
                {
                    chickenshashlik++;
                }
    
    
                if (submenu == 3 )
                {
                    thaisoup++;
                }
    
    
                if (submenu == 4 )
                {
                    noodles++;
                }
    
    
                if (submenu == 5 )
                {
                    snacks++;
                }
    
    
                if (submenu == 6 )
                {
                    chickentikka++;
                }
    
    
                if (submenu == 7 )
                {
                    katakut++;
                }
    
    
                if (submenu == 8 )
                {
                    rashmikabab++;
                }
    
    
                if (submenu == 9 )
                {
                    chickenkerhai++;
                }
    
    
                if (submenu == 10 )
                {
                    biryani++;
                }
    
    
                if (submenu == 11 )
                {
                    quorma++;
                }
    
    
                if (submenu == 12 )
                {
                    nan++;
                }
    
    
                if (submenu == 13 )
                {
                    taftan++;
                }
    
    
                if (submenu == 14 )
                {
                    coke++;
                }
    
    
                if (submenu == 15 )
                {
                    sevenup++;
                }
    
    
                if (submenu == 16 )
                {
                    coffee++;
                }
    
    
                if (submenu == 17 )
                {
                    tea++;
                }
    
    
    
    
                if (submenu > 18)
                {
                    nextline();
                    cout << '\t' << "PRESS ZERO ( 0 ) TO RETURN BACK TO MAIN MENU \n";
                    nextline();
                    cout << '\t' << "PRESS ( 18 ) TO EXIT AND PRINT YOUR ORDER \n";
                    nextline();
                    cout << '\t' << "PLEASE PLACE YOUR ORDER HERE : ";
                    cin >> submenu;
                    nextline(); nextline();
                }
    
    
                    else if ( submenu == 18 )
                {
                    aboveline();
                    nextline();nextline();nextline();
                    cout << '\t' << "YOU ORDERED FOLLOWING FOODS : \n";
                    nextline(); nextline();
                    belowline();
    
    
                    cout << '\t'<< "01- Fried Rice :" " " << friedrice << "\n"; nextline();
                    cout << '\t'<< "02- Chicken Shashlik :" " " << chickenshashlik << "\n"; nextline();
                    cout << '\t'<< "03- Thai Soup :" " " << thaisoup << "\n"; nextline();
                    cout << '\t'<< "04- Noodles :" " " << noodles << "\n"; nextline();
                    cout << '\t'<< "05- Snacks :" " " << snacks << "\n"; nextline();
                    cout << '\t'<< "06- Chicken Tikka :" " " << chickentikka << "\n"; nextline();
                    cout << '\t'<< "07- Kata Kut :" " " << katakut << "\n"; nextline();
                    cout << '\t'<< "08- Rashmi Kabab :" " " << rashmikabab << "\n"; nextline();
                    cout << '\t'<< "09- Chicken Kerhai :" << chickenkerhai << "\n"; nextline();
                    cout << '\t'<< "10- Biryani :" " " << biryani << "\n"; nextline();
                    cout << '\t'<< "11- Qourma :" " " << quorma << "\n"; nextline();
                    cout << '\t'<< "12- Nan :" " " << nan << "\n"; nextline();
                    cout << '\t'<< "13- Taftan :" " " << taftan << "\n"; nextline();
                    cout << '\t'<< "14- Coke : " " " << coke << "\n"; nextline();
                    cout << '\t'<< "15- 7-Up : " " " << sevenup << "\n"; nextline();
                    cout << '\t'<< "16- Coffee :" " " << coffee << "\n"; nextline();
                    cout << '\t'<< "17- Tea : " " " << tea << "\n"; nextline();
                    belowline();
                    cout << '\t' << "THANK YOU FOR YOUR ORDER - WE WILL DELIVER IT TO YOU SOON \n";
                    nextline(); nextline();
    
    
                    break;
                }
    
    
            }
    
    
    }
    
    
    char mainmenucard (void)
              {
              aboveline();
              nextline(); nextline(); nextline();nextline();
    
    
              cout << tabulation2() << tabulation2() << "'MAIN MENU CARD \n";
              cout << tabulation2() << tabulation2() << " ______________ \n";
              nextline(); nextline();
    
    
              cout << tabulation2() << " I T E M S \n";
              cout << tabulation2() << " _________ \n";
              nextline(); nextline(); nextline();
    
    
              cout << tabulation2() << "1- CHINESE CUISINE \n";
              nextline();nextline();
    
    
              cout << tabulation2() << "2- BAR B-Q \n";
              nextline();nextline();
    
    
              cout << tabulation2() << "3- PAKISTANIS CUISINE \n";
              nextline(); nextline();
    
    
              cout << tabulation2() << "4- BEVERAGES \n";
              nextline(); nextline();
              belowline();
    
    
              cout << tabulation2() << "PLEASE INPUT YOUR OPTION 1, 2, 3 OR 4 \n"; nextline();
              cout << tabulation2() << "FROM MAIN MENU TO CHECK SUB MENU CARD: ";
              }
    
    
    char nextline(void)
        {
          cout << '\n';
    
    
        }
    
    
    char tabulation2()
    {
        cout << '\t' << '\t';
    }
    
    
    char aboveline()
    {
      nextline(); nextline();
      cout << '\t' << " *************************************************************** ";
    }
    
    
    char belowline ()
    {
       cout << '\t' << " *************************************************************** ";
       nextline(); nextline();
    }
    
    
    
    
    char chinesecuisine()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "I- CHINESE CUISINE \n";
        cout << tabulation2() << "__________________ \n";
        nextline();
    
    
        cout << tabulation2() << "1- Fried Rice \n";
        nextline();
    
    
        cout << tabulation2() << "2- Chicken Shashlik \n";
        nextline();
    
    
        cout << tabulation2() << "3- Thai Soup \n";
        nextline();
    
    
        cout << tabulation2() << "4- Noodles \n";
        nextline();
    
    
        cout << tabulation2()  << "5- Snacks \n";
        nextline(); belowline();
    }
    
    
    char barbq()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "II- BAR B-Q \n";
        cout << tabulation2() << "__________ \n";
        nextline();
    
    
        cout << tabulation2() << "6- Chicken Tikka \n";
        nextline();
    
    
        cout << tabulation2() << "7- Kata Kut \n";
        nextline();
    
    
        cout << tabulation2() << "8- Rashmi Kabab \n";
        nextline();
        cout << belowline();
    }
    
    
    char pakistanicuisine()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "III- PAKISTANIS CUISINE \n";
        cout << tabulation2() << "_______________________ \n";
        nextline();
    
    
        cout << tabulation2() << "9- Chicken Kerhai \n";
        nextline();
    
    
        cout << tabulation2() << "10- Biryani \n";
        nextline();
    
    
        cout << tabulation2() << "11- Qourma \n";
        nextline();
    
    
        cout << tabulation2() << "12- Nan \n";
        nextline();
    
    
        cout << tabulation2() << "13- Taftan \n";
        nextline();
        belowline();
    }
    
    
    char beverages()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "IV- BEVERAGES \n";
        cout << tabulation2() << "_____________ \n";
        nextline();
    
    
        cout << tabulation2() << "14- Coke \n";
        nextline();
    
    
        cout << tabulation2() << "15- 7-Up \n";
        nextline();
    
    
        cout << tabulation2() << "16- Coffee \n";
        nextline();
    
    
        cout << tabulation2()<< "17- Tea \n";
        nextline();
        belowline();
    }
    Last edited by khanzhut; 02-11-2014 at 04:29 AM.

  2. #2
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,787
    Just as a thought, what would happen if the menu was expanded and customers had the choice of 512 different meals?

    The predicament this would present is (probably) not your fault but your teacher's fault. I hate the stupid menu programs. Nobody has programmed this stuff for a long, long time -- basically because it's a waste of time.

    Edit: I'd like to amend my statement. Nobody has ever written code like this because, essentially, back in ye olden days there was no RAM to write code like this. Please ask your teacher to contact me. Thanks.

    Edit 2: I'm sorry if I seem to be in a non-supportive mood but I'm tired of seeing crap like this (not your fault!) being constantly, over and over and over and over, being posted on this board. This kind of program isn't "programming", it's just rubbish. You've wasted a lot of time to write 460 lines of code that I'm sure your teacher may like but it's just not how things work.[/rant]

    Edit 3: I'll have the Thai Soup
    Last edited by Hodor; 02-11-2014 at 04:51 AM.

  3. #3
    Registered User
    Join Date
    Feb 2014
    Posts
    12
    Thanks Hodor for your comments ..... I think you didn't see the subject line which clearly specify the word "Basic".

    I would say that it is a program written by a person who is new to C++ programming and have completed only few chapters in just two weeks time. Moreover, it is a practice program of Functions with little knowledge of programming.

  4. #4
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,787
    Quote Originally Posted by khanzhut View Post
    Thanks Hodor for your comments ..... I think you didn't see the subject line which clearly specify the word "Basic".

    I would say that it is a program written by a person who is new to C++ programming and have completed only few chapters in just two weeks time. Moreover, it is a practice program of Functions with little knowledge of programming.
    Oh, I saw the keyword "basic". For 500 lines (give or take) what have you learned? The if statement (unfortunately not else if which is probably why your program is broken) and while. This has nothing to do with you, maybe you find the menu exercise exciting! It's about teaching. This huge assignment is aimed at teaching you two very basic concepts in a very unrealistic way. I'm sorry, I just find it absurd that people would assign homework like this.

    And after this 500 lines of code I wager you still don't know what was taught (well, not taught) -- flow control.

  5. #5
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    FAQ > Clear the screen? - Cprogramming.com


    Code:
        int mainmenu;
        mainmenu = (1,2,3,4);
     
     
        int submenu;
        submenu = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18);
    Those assignment statements don't do whatever it is that you think that they do. Essentially all you are doing here is assigning 4 to mainmenu and 18 to submenu.

    Code:
    while (0);
           {
    Two problems here. 0 is false in C/C++ and so while(0) will result in the body of the loop never being evaluated. This can have some uses but as you don't seem to have any labels inside the loop I'd say that it is an error. Additionally the body of the loop is only the empty statement ( ; ) and so it isn't having a significant effect on your program. The two errors kind of cancel out.

    I'm not sure why you're expecting your program to go back to the main menu when you haven't programmed it that way. You are displaying the menu again and then getting input but you're not dealing with that input. A better way would probably be to have your submenu loop inside your menu loop I suppose. To be honest though I'm kind of having a hard time bending my mind around what you are supposed to do so that could be wrong.

    Code:
     if (submenu > 18)
                {
                    nextline();
                    cout << '\t' << "PRESS ZERO ( 0 ) TO RETURN BACK TO MAIN MENU \n";
                    nextline();
                    cout << '\t' << "PRESS ( 18 ) TO EXIT AND PRINT YOUR ORDER \n";
                    nextline();
                    cout << '\t' << "PLEASE PLACE YOUR ORDER HERE : ";
                    cin >> submenu;
                    nextline(); nextline();
                }
    This code is redundant/duplicate code.

  6. #6
    Registered User
    Join Date
    Feb 2014
    Posts
    12
    @ Hodor:


    Don't blame the teacher, just blame me because I don't have any teacher. I am learning C++ from the Book "Jumping into C++" by myself. And I have just finished sixth Chapter learned only few basics e.g., Conditional Statements, Loops and Functions.


    On the basis of it, I tried to accomplish my assignment given at the end of Chapter-6.


    I thought this platform is meant for learning and sharing knowledge to/with others. However, if my stupid Codes/Program really so much annoyed you, I won't put such rubbish codes/crap on this board in future where such an intelegent people like you exits.


    Meanwhile, I would sugges just to copy the codes and run them into your Compiler twice. Firstly without using the Input Zero and
    secondly with the Zero Input. You would definitely notice that the program didn't broken rather at first time the program would run perfectly till the end. However, at the second time the program would also run till the end but it won't show the Sub-Menu Card either.




    @ DeadPlanet:


    The problem is not with the int mainmenu or submenu code.


    If I would use While (1) in my loop, the program would stop at first stage and never goes beyond it. That's why I used While (0).


    I have checked to input submenu loop inside menu loop, but it didn't work either.


    The,
    Code:
     if (submenu > 18) { ..... code .... }
    , is not redundant/duplicate code. Rather, it would revalidate or check the wrong input of user (if he/she input the value greater than 17).


    I have also detected the problem relates to my codes/program i.e, I have set mainmenucard functions outside the main block whereas I put/call the said function 2nd time within a submenu loop that's why the program only perform as per instructions set therewith.
    Last edited by khanzhut; 02-11-2014 at 09:36 AM.

  7. #7
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by khanzhut View Post
    If I would use While (1) in my loop, the program would stop at first stage and never goes beyond it. That's why I used While (0).
    You completely missed the point here. In your code, this is the whole entirety of your loop:
    Code:
    ;
    That's not much of a loop. If you want that while loop to actually loop, you need to remove that semicolon after "while" so that the curly-brace block becomes your while loop. (A while loop consists of the very next thing after the word "while", and you have a semicolon as the very next thing, so that's all the loop you get.)

  8. #8
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by khanzhut View Post
    If I would use While (1) in my loop, the program would stop at first stage and never goes beyond it. That's why I used While (0).
    in fact, just the opposite is true. while (0) will not execute the loop even once. while (1) will execute forever, or until a break or return statement is encountered. if the condition inside the parentheses of a while statement evaluate to false (0 is false), the loop stops. your problem is the semicolon after the while (0).
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  9. #9
    Registered User
    Join Date
    Feb 2014
    Posts
    12
    Quote Originally Posted by tabstop View Post
    You completely missed the point here. In your code, this is the whole entirety of your loop:
    Code:
    ;
    That's not much of a loop. If you want that while loop to actually loop, you need to remove that semicolon after "while" so that the curly-brace block becomes your while loop. (A while loop consists of the very next thing after the word "while", and you have a semicolon as the very next thing, so that's all the loop you get.)

    @ tapstop: Yeah .... you right. Basically, first I used do - while loop but later-on I deleted do and only used while loop. But, unfortunately, I didn't delete semicolon from the while loop. However, when I deleted semicolon and put (1) inside while loop and then run the program, the loop became infinite loop.

  10. #10
    Registered User
    Join Date
    Feb 2014
    Posts
    12
    Quote Originally Posted by Elkvis View Post
    in fact, just the opposite is true. while (0) will not execute the loop even once. while (1) will execute forever, or until a break or return statement is encountered. if the condition inside the parentheses of a while statement evaluate to false (0 is false), the loop stops. your problem is the semicolon after the while (0).

    Yeap ... you are right.

  11. #11
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    Quote Originally Posted by khanzhut View Post
    The,
    Code:
     if (submenu > 18) { ..... code .... }
    , is not redundant/duplicate code. Rather, it would revalidate or check the wrong input of user (if he/she input the value greater than 17).
    Which will also occur without that code when the program returns to the start of the containing loop...

  12. #12
    Registered User
    Join Date
    Feb 2014
    Posts
    12
    Quote Originally Posted by DeadPlanet View Post
    Which will also occur without that code when the program returns to the start of the containing loop...
    OK .... I have changed the code as:

    Code:
    else if (submenu > 18)
                {
                    nextline();
                    cout << '\t' << "YOU ENTERED WRONG VALUE ... PLEASE TRY AGAIN : ";
                    cin >> submenu;
                    nextline(); nextline();
                }

  13. #13
    Registered User
    Join Date
    Feb 2014
    Posts
    12
    Thanks God ..... I have corrected the problem with the help of you people and are reproducing my codes again .... its perfectly running.

    Code:
    #include <iostream>
    
    
    using namespace std;
    
    
    // DECLARING FUNCTIONS
    
    
    char mainmenucard (void);
    char chinesecuisine(void);
    char barbq(void);
    char pakistanicuisine(void);
    char beverages(void);
    
    
    char aboveline(void);
    char belowline(void);
    char nextline(void);
    
    
    char tabulation2(void);
    
    
    // START MAIN
    
    
    int main()
    {
    
    
        // DEFINING VARIABLES
    
    
        int mainmenu;
        mainmenu = (1,2,3,4);
    
    
        int submenu;
        submenu = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18);
    
    
        int friedrice = 0;
        int chickenshashlik = 0;
        int thaisoup = 0;
        int noodles = 0;
        int snacks = 0;
        int chickentikka = 0;
        int katakut = 0;
        int rashmikabab = 0;
        int chickenkerhai = 0;
        int biryani = 0;
        int quorma = 0;
        int nan = 0;
        int taftan = 0;
        int coke = 0;
        int sevenup = 0;
        int coffee = 0;
        int tea = 0;
    
    
        // WELCOME SCREEN
    
    
              aboveline();
              nextline(); nextline(); nextline();
    
    
              cout << '\t' << "    " << "!.....  WELCOME TO THE DELICIOUS FOODS RESTAURANT .....!";
              nextline();
    
    
              mainmenucard();
              cin >> mainmenu;
              nextline(); nextline();
    
    
           // MAIN MENU CARD AND INPUT INSTRUCTIONS
    
    
           while (1)
           {
    
    
                if (mainmenu == 1 )
                {
                    chinesecuisine();
                }
    
    
                else if (mainmenu == 2 )
                {
                    barbq();
                }
    
    
                else if (mainmenu == 3 )
                {
                    pakistanicuisine();
                }
    
    
                else if (mainmenu == 4 )
                {
                    beverages();
                }
    
    
                if ( mainmenu < 1 || mainmenu > 4 )
                {
                    cout << tabulation2() << "YOU INPUT WRONG VALUE - PLEASE TRY AGAIN : ";
                    cin >> mainmenu;
                    nextline(); nextline();
                }
    
    
    
    
               // INSTRUCTION FOR SUB-MENU CARD, RETURN BACK TO MAIN MENU OR INSTRUCTION TO EXIT / PRINT ORDER
    
    
                nextline();
                cout << tabulation2() << "PRESS ZERO ( 0 ) TO RETURN BACK TO MAIN MENU \n";
                nextline();
                cout << tabulation2() << "PRESS ( 18 ) TO EXIT AND PRINT YOUR ORDER \n";
                nextline();
                cout << tabulation2() << "PLEASE PLACE YOUR ORDER HERE : ";
                cin >> submenu;
                nextline(); nextline();
    
    
                if (submenu == 0)
                {
                    mainmenucard();
                    cin >> mainmenu;
                    nextline(); nextline();
                }
    
    
                if (submenu == 1 )
                {
                    friedrice++;
                }
    
    
                else if (submenu == 2 )
                {
                    chickenshashlik++;
                }
    
    
                else if (submenu == 3 )
                {
                    thaisoup++;
                }
    
    
                if (submenu == 4 )
                {
                    noodles++;
                }
    
    
                else if (submenu == 5 )
                {
                    snacks++;
                }
    
    
                else if (submenu == 6 )
                {
                    chickentikka++;
                }
    
    
                else if (submenu == 7 )
                {
                    katakut++;
                }
    
    
                else if (submenu == 8 )
                {
                    rashmikabab++;
                }
    
    
                else if (submenu == 9 )
                {
                    chickenkerhai++;
                }
    
    
                else if (submenu == 10 )
                {
                    biryani++;
                }
    
    
                else if (submenu == 11 )
                {
                    quorma++;
                }
    
    
                else if (submenu == 12 )
                {
                    nan++;
                }
    
    
                else if (submenu == 13 )
                {
                    taftan++;
                }
    
    
                else if (submenu == 14 )
                {
                    coke++;
                }
    
    
                else if (submenu == 15 )
                {
                    sevenup++;
                }
    
    
                else if (submenu == 16 )
                {
                    coffee++;
                }
    
    
                else if (submenu == 17 )
                {
                    tea++;
                }
    
    
                // REVALIDATE THE PROGRAM IF USER INPUT WRONG VALUE GREATER THAN 17
    
    
                else if (submenu > 18)
                {
                    nextline();
                    cout << tabulation2() << "YOU ENTERED WRONG VALUE ... PLEASE TRY AGAIN : ";
                    cin >> submenu;
                    nextline(); nextline();
                }
    
    
                // IF INPUT = 18, EXIT AND PRINT ORDER
    
    
                    else if ( submenu == 18 )
                {
                    aboveline();
                    nextline();nextline();nextline();
                    cout << '\t' << "YOU ORDERED FOLLOWING FOODS : \n";
                    nextline(); nextline();
                    belowline();
    
    
                    cout << '\t'<< "01- Fried Rice :" " " << friedrice << "\n"; nextline();
                    cout << '\t'<< "02- Chicken Shashlik :" " " << chickenshashlik << "\n"; nextline();
                    cout << '\t'<< "03- Thai Soup :" " " << thaisoup << "\n"; nextline();
                    cout << '\t'<< "04- Noodles :" " " << noodles << "\n"; nextline();
                    cout << '\t'<< "05- Snacks :" " " << snacks << "\n"; nextline();
                    cout << '\t'<< "06- Chicken Tikka :" " " << chickentikka << "\n"; nextline();
                    cout << '\t'<< "07- Kata Kut :" " " << katakut << "\n"; nextline();
                    cout << '\t'<< "08- Rashmi Kabab :" " " << rashmikabab << "\n"; nextline();
                    cout << '\t'<< "09- Chicken Kerhai :" << chickenkerhai << "\n"; nextline();
                    cout << '\t'<< "10- Biryani :" " " << biryani << "\n"; nextline();
                    cout << '\t'<< "11- Qourma :" " " << quorma << "\n"; nextline();
                    cout << '\t'<< "12- Nan :" " " << nan << "\n"; nextline();
                    cout << '\t'<< "13- Taftan :" " " << taftan << "\n"; nextline();
                    cout << '\t'<< "14- Coke : " " " << coke << "\n"; nextline();
                    cout << '\t'<< "15- 7-Up : " " " << sevenup << "\n"; nextline();
                    cout << '\t'<< "16- Coffee :" " " << coffee << "\n"; nextline();
                    cout << '\t'<< "17- Tea : " " " << tea << "\n"; nextline();
                    belowline();
    
    
                    // THANKS MESSAGE
    
    
                    cout << '\t' << "THANK YOU FOR YOUR ORDER - WE WILL DELIVER IT TO YOU SOON \n";
                    nextline(); nextline();
    
    
                    break;
            }
    
    
            }
    
    
    }
    
    
    // DEFINING FUNCTIONS
    
    
    char mainmenucard (void)
              {
              aboveline();
              nextline(); nextline(); nextline();nextline();
    
    
              cout << tabulation2() << tabulation2() << "'MAIN MENU CARD \n";
              cout << tabulation2() << tabulation2() << " ______________ \n";
              nextline(); nextline();
    
    
              cout << tabulation2() << " I T E M S \n";
              cout << tabulation2() << " _________ \n";
              nextline(); nextline(); nextline();
    
    
              cout << tabulation2() << "1- CHINESE CUISINE \n";
              nextline();nextline();
    
    
              cout << tabulation2() << "2- BAR B-Q \n";
              nextline();nextline();
    
    
              cout << tabulation2() << "3- PAKISTANIS CUISINE \n";
              nextline(); nextline();
    
    
              cout << tabulation2() << "4- BEVERAGES \n";
              nextline(); nextline();
              belowline();
    
    
              cout << tabulation2() << "PLEASE INPUT YOUR OPTION 1, 2, 3 OR 4 \n"; nextline();
              cout << tabulation2() << "FROM MAIN MENU TO CHECK SUB MENU CARD: ";
              }
    
    
    char chinesecuisine()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "I- CHINESE CUISINE \n";
        cout << tabulation2() << "__________________ \n";
        nextline();
    
    
        cout << tabulation2() << "1- Fried Rice \n";
        nextline();
    
    
        cout << tabulation2() << "2- Chicken Shashlik \n";
        nextline();
    
    
        cout << tabulation2() << "3- Thai Soup \n";
        nextline();
    
    
        cout << tabulation2() << "4- Noodles \n";
        nextline();
    
    
        cout << tabulation2()  << "5- Snacks \n";
        nextline(); belowline();
    }
    
    
    char barbq()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "II- BAR B-Q \n";
        cout << tabulation2() << "__________ \n";
        nextline();
    
    
        cout << tabulation2() << "6- Chicken Tikka \n";
        nextline();
    
    
        cout << tabulation2() << "7- Kata Kut \n";
        nextline();
    
    
        cout << tabulation2() << "8- Rashmi Kabab \n";
        nextline();
        cout << belowline();
    }
    
    
    char pakistanicuisine()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "III- PAKISTANIS CUISINE \n";
        cout << tabulation2() << "_______________________ \n";
        nextline();
    
    
        cout << tabulation2() << "9- Chicken Kerhai \n";
        nextline();
    
    
        cout << tabulation2() << "10- Biryani \n";
        nextline();
    
    
        cout << tabulation2() << "11- Qourma \n";
        nextline();
    
    
        cout << tabulation2() << "12- Nan \n";
        nextline();
    
    
        cout << tabulation2() << "13- Taftan \n";
        nextline();
        belowline();
    }
    
    
    char beverages()
    {
        aboveline();
        nextline(); nextline();
        cout << tabulation2() << "IV- BEVERAGES \n";
        cout << tabulation2() << "_____________ \n";
        nextline();
    
    
        cout << tabulation2() << "14- Coke \n";
        nextline();
    
    
        cout << tabulation2() << "15- 7-Up \n";
        nextline();
    
    
        cout << tabulation2() << "16- Coffee \n";
        nextline();
    
    
        cout << tabulation2()<< "17- Tea \n";
        nextline();
        belowline();
    }
    
    
    char aboveline()
    {
      nextline(); nextline();
      cout << '\t' << " *************************************************************** ";
    }
    
    
    char belowline ()
    {
       cout << '\t' << " *************************************************************** ";
       nextline(); nextline();
    }
    
    
    char nextline(void)
        {
          cout << '\n';
    
    
        }
    
    
    char tabulation2()
    {
        cout << '\t' << '\t';
    }

    Edit: You may try it by yourself in your Compiler.
    Last edited by khanzhut; 02-11-2014 at 11:45 AM.

  14. #14
    Registered User
    Join Date
    Feb 2014
    Posts
    12
    And special thanks to DeadPlanet for pointing out the errors in my codes and resolving my problem.

  15. #15
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Actually, your functions all return a char, or so you've told the compiler, but you are in reality not returning anything. That's an error. This will not compile on some compilers.
    You probably meant that the function should not return anything, so you should change their return type to void.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C program restaurant waiting line
    By jamierkent in forum C Programming
    Replies: 6
    Last Post: 11-25-2013, 04:19 PM
  2. Booking in a theatre program
    By AceRockson in forum C Programming
    Replies: 7
    Last Post: 01-30-2012, 10:38 AM
  3. Menu for Restaurant Program.
    By francozb92 in forum C Programming
    Replies: 4
    Last Post: 04-03-2011, 09:49 AM
  4. Replies: 9
    Last Post: 04-01-2011, 04:13 PM
  5. Booking seats program question..
    By snapshooter in forum C++ Programming
    Replies: 7
    Last Post: 12-24-2004, 06:09 PM

Tags for this Thread