Thread: NEED Help for my assignment about restaurant billing

  1. #1
    Registered User
    Join Date
    Oct 2014
    Posts
    7

    Question NEED Help for my assignment about restaurant billing

    Hello dear, i am a newbie of c programing . Today i faced a problem about my new assignment. please someone help me.
    the problem is......

    **Write a program to manage Food order in a restaurant. In a restaurant, the food order contains food number, size, and quantity. The order is served in the form of first come first serve basis. Your program will display total number of orders received, served and waiting at any point in time.

    please somebody help me by write this code.
    sorry for my poor english.

  2. #2
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Sure.

    What have you done so far?
    Fact - Beethoven wrote his first symphony in C

  3. #3
    Registered User
    Join Date
    Oct 2014
    Posts
    7

    i have no idea about it

    Quote Originally Posted by Click_here View Post
    Sure.

    What have you done so far?
    i have no idea about it. i m new in c .

  4. #4
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Well what do you know?

    What have you done in your programming class?

    You may also want to have a quick read of the homework policy Announcements - General Programming Boards
    Fact - Beethoven wrote his first symphony in C

  5. #5
    Registered User
    Join Date
    Oct 2014
    Posts
    7
    Quote Originally Posted by Click_here View Post
    Well what do you know?

    What have you done in your programming class?

    You may also want to have a quick read of the homework policy Announcements - General Programming Boards

    i just starting data structure in my class. i know about singly linked list something.

  6. #6
    Tweaking master Aslaville's Avatar
    Join Date
    Sep 2012
    Location
    Rogueport
    Posts
    528
    Quote Originally Posted by Sunny Sultan View Post
    i just starting data structure in my class. i know about singly linked list something.
    Well, if you are in a data structures class, you already know some programming(by which I mean you can be able to write some code, then we can help you get the code working).

  7. #7
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Phase 1: Planning

    Close your editor and grab a pencil and paper. Start jotting down some notes and ideas from reading over the assignment. At the very least, get a general feel for how you might satisfy the requirements. You should be able to figure out what kind of variables you'll need, and a general flow of how the logic should work.

    Phase 2: Develop Code

    Start with your "hello world" program. Look at the assignment and, using the notes you've taken, pick out one small piece to start with. Write a few lines of code to solve this piece. Compile, fix any warnings/errors, and test. When you're absolutely sure you have that piece working, pick out another small piece. Write another few lines of code ... and repeat this process, gradually building up your program, testing as you go.

    A development process

    If at any point you get stuck along the way, feel free to post your (specific and clearly written) question, along with the code you have developed so far.

  8. #8
    Registered User
    Join Date
    Oct 2014
    Posts
    7

    no one can help me.

    i understand no one can help me.

  9. #9
    Registered User
    Join Date
    Nov 2011
    Posts
    161
    Quote Originally Posted by Sunny Sultan View Post
    i understand no one can help me.

    A lot of people here can help you.
    But no one here will do all your work for you.
    That would not be helping you. You would never learn C that way.

  10. #10
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Let's see some code, and tell us where you're stuck. After all, if you're up to singly linked lists (or "something"), you should be able to at least start this assignment.

  11. #11
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Quote Originally Posted by Sunny Sultan View Post
    i understand no one can help me.
    Without you putting in any effort, no one will help you.
    Fact - Beethoven wrote his first symphony in C

  12. #12
    Registered User
    Join Date
    Oct 2014
    Posts
    7
    Code:
    #include<stdio.h>
    #include<string.h>
    #define MAX 50;
    int menu(int total);
    struct resturant{
    char name[20];
    int total;
    }rest1;
    
    
    int main()
    {
        int count=0,n=1,total,i,j,total1=0,m=0;
    
        printf("Enter Your name: \n");
    
        count++;
        for(i=count;i<=100;i++){
        gets(rest1.name);
        break;
        }
        total=menu(total1);
        for(j=count;j<100;j++)
        rest1.total=total;
        printf("Press enter to see your order\n");
        printf("Name: %c",rest1.name[20]);
        printf("Total: %d",rest1.total);
        return 0;
    
    
    }
    
    
    int menu(int total)
    {   int num;
        do{
        printf("choise food\n");
           //Menu
        printf("No. Remark\n");
        printf("1  Burger(60 TK)\n");
    
        printf("2  PIZZA(120 TK)\n");
    
        printf("3  Roll(70 TK)\n");
    
        printf("4  chiken ball(30 TK)\n");
        printf("5  Ice cream(20 TK)\n");
        printf("6  Exit");
    
        printf("Please Select Your Option from Above Menu(1--6) : ");
    
        scanf("%d",&num);
        if(num==1)
        total=total+60;
        else if(num==2)
        total=total+120;
        else if(num==3)
        total=total+70;
        else if(num==4)
        total=total+30;
        else if(num==5)
        total=total+20;
        else if(num==6)
        return total;
        else printf("invaliddddd");
        }
        while(1);
    }
    Last edited by Sunny Sultan; 10-05-2014 at 05:33 AM.

  13. #13
    Registered User
    Join Date
    Oct 2014
    Posts
    7
    Quote Originally Posted by Matticus View Post
    Let's see some code, and tell us where you're stuck. After all, if you're up to singly linked lists (or "something"), you should be able to at least start this assignment.
    Code:
    #include<stdio.h>
    #include<string.h>
    #define MAX 50;
    int menu(int total);
    struct resturant{
    char name[20];
    int total;
    }rest1;
     
     
    int main()
    {
        int count=0,n=1,total,i,j,total1=0,m=0;
     
        printf("Enter Your name: \n");
     
        count++;
        for(i=count;i<=100;i++){
        gets(rest1.name);
        break;
        }
        total=menu(total1);
        for(j=count;j<100;j++)
        rest1.total=total;
        printf("Press enter to see your order\n");
        printf("Name: %c",rest1.name[20]);
        printf("Total: %d",rest1.total);
        return 0;
     
     
    }
     
     
    int menu(int total)
    {   int num;
        do{
        printf("choise food\n");
           //Menu
        printf("No. Remark\n");
        printf("1  Burger(60 TK)\n");
     
        printf("2  PIZZA(120 TK)\n");
     
        printf("3  Roll(70 TK)\n");
     
        printf("4  chiken ball(30 TK)\n");
        printf("5  Ice cream(20 TK)\n");
        printf("6  Exit");
     
        printf("Please Select Your Option from Above Menu(1--6) : ");
     
        scanf("%d",&num);
        if(num==1)
        total=total+60;
        else if(num==2)
        total=total+120;
        else if(num==3)
        total=total+70;
        else if(num==4)
        total=total+30;
        else if(num==5)
        total=total+20;
        else if(num==6)
        return total;
        else printf("invaliddddd");
        }
        while(1);
    }

  14. #14
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    In your code you could use some improved indentation and there are some strange things. For example what is the purpose of the for loop in this portion?

    Code:
    for(i=count;i<=100;i++){
        gets(rest1.name);
        break;
    }
    Also it's been mentioned but gets is not a good function to use. What happens if I type more than 20 characters? I would use fgets.

    Also you posted code but didn't say what is wrong. Does it not work or what?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help!! Restaurant Simulation in C
    By HexXP in forum C Programming
    Replies: 10
    Last Post: 11-24-2013, 02:39 PM
  2. Restaurant
    By bdkminang in forum C++ Programming
    Replies: 3
    Last Post: 02-18-2011, 08:44 AM
  3. Billing street address.
    By JOZZY& Wakko in forum General Discussions
    Replies: 6
    Last Post: 12-04-2009, 06:21 PM
  4. Recurring Billing on PayFlowPro
    By stanleyjgs in forum C# Programming
    Replies: 0
    Last Post: 03-24-2008, 07:51 PM
  5. algorithm for rate based billing?
    By Wexy in forum C Programming
    Replies: 4
    Last Post: 11-28-2002, 11:19 PM

Tags for this Thread