term paperc

Upload: sharmajal

Post on 09-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Term PaperC

    1/22

    Term paper

    OfFoundations of computing

    Fast food automation system

    Submitted to: Submitted by:

    Ms. Harsimran Kaur Nidhi Sharma

    Lec.in computers R262B46

    LPU 262

  • 8/8/2019 Term PaperC

    2/22

    Table of contents:1. Introduction

    2. Proposed system

    (a) Description

    (b) System requirements

    3. Requirement analysis

    4. System design

    5. Source code

    6. Testing

    7. Future scope of the project

  • 8/8/2019 Term PaperC

    3/22

    Introduction:Fast food automation system is a program based on C language. Generally ,invarious fast food malls and stores we see a number of workers working there to give

    different items to people. The head of that particular mall has to give them salaries

    accordingly. By using this , fast food automation program the problem of workers

    as well as money get minimized to a great extent. C is a programming language

    developed at Bell laboratories of USA in1972. It was designed and written by a man

    named Dennis Ritchie. Possibly C seems so popular because it is reliable, simple

    and easy to use.

    Moreover in an industry where newer languages tools and technologies emerge

    and vanish day in and day out, a language that has survived for more than three

    decades has to be really good .An opinion that is often heard today is C language

    has been already superceded by languages like C++, C# and JAVA.

    My project is program on fast food automation system using C language .

    Proposed system:(a) Description:Windows XP professional

    Microsoft windows

  • 8/8/2019 Term PaperC

    4/22

    (b) System requirements:

    PC (RAM): 256 MB

    LAPTOP (RAM): 1 GB

    Requirement Analysis:Keywords

    Keywords are identifiers reserved by the language for special use. Although

    you can use them for preprocessor macro names, it is considered poor

    programming style. Only the exact spelling of keywords is reserved. Forexample, auto is reserved but AUTO is not.

    Break:

    Passes control out of the compound statement.

    The break statement causes control to pass to the statement following the

    innermost enclosing while, do, for, or switch statement. The syntax is simply

    break;

    int, char

  • 8/8/2019 Term PaperC

    5/22

    Basic data types (integer and character)

    Variables of type int are one machine-type word in length. They can be

    signed (default) or unsigned, which means that in this configuration of the

    compiler they have by default a range of -32768 to 32767 and 0 to 65535

    respectively, but this default may be changed if the compiler option '-

    mnoshort' is given. In this case, the range of type int is -2147483648 to

    2147483647 for signed case, or 0 to 4294967295 for unsigned case. See also

    short and long type modifiers.

    Variables of type char are 1 byte in length. They can be signed (this is the

    default, unless you use the compiler option '-funsigned-char') or unsigned,

    which means they have a range of -128 to 127 and 0 to 255, respectively.

    All data types may be used for defining variables, specifying return types of

    functions, and specifying types of function arguments. For example,

    int a, b, c; // 'a', 'b', 'c' are integer variable

    All data type keywords may be used in combination with asterisks, brackets

    and parentheses, for making complex data types, like pointer types, array

    types, function types, or combinations of them, which in the C language may

    have an arbitrary level of complexity (see asterisk for more info).

    switch, case, default:

    switch causes control to branch to one of a list of possible statements in the

    block of statements. The syntax is

  • 8/8/2019 Term PaperC

    6/22

    switch (expression) statement

    The statement statement is typically a compound statement (i.e. a block of

    statements enclosed in braces). The branched-to statement is determined byevaluating expression, which must return an integral type. The list of possible

    branch points within statement is determined by preceding substatements

    with

    case constant-expression :

    where constant-expression must be an int and must be unique.

    Once a value is computed for expression, the list of possible constant-

    expression values determined from all case statements is searched for a

    match. If a match is found, execution continues after the matching case

    statement and continues until a break statement is encountered or the end of

    statement is reached. If a match is not found and this statement prefix is

    found within statement,

    default :

    execution continues at this point. Otherwise, statement is skipped entirely.

    void

    Empty data type.

    When used as a function return type, void means that the function does not

    return a value. For example,

    void hello (char *name)

  • 8/8/2019 Term PaperC

    7/22

    {

    printf("Hello, %s.", name);

    }

    When found in a function heading, void means the function does not take any

    parameters

    while

    Repeats execution while the condition is true.

    Keyword while is the most general loop statemens. It uses the following

    syntax:

    while (expression) statement

    statement is executed repeatedly as long as the value of expression remains

    nonzero. The test takes place before each execution of the statement. For

    example,

    while (*p == ' ') p++;

    Of course, statement may be a compound statement as well.

    System design:Please choose from the following:

    1. Press M to see the menu

  • 8/8/2019 Term PaperC

    8/22

    2. Press B to see generate bill

    3. Press E to exit

    4. Press any key to continue

    Source code:

    Program on Fast Food

    Automation System

    #include

    #include

    void menu();

    void billGenerate();

    void main()

    {

    char cChoice;

    clrscr();

    while(cChoice!='e')

    {

    clrscr();

    printf("\n***************Please Choose From Following.********!");

    printf("\n\n M. To See the Menu");

  • 8/8/2019 Term PaperC

    9/22

    printf("\n\n B. To See Generate Bill");

    printf("\n\n E. To Exit");

    cChoice=getch();

    //scanf("%c",&cChoice);

    switch(cChoice)

    {

    case 'm':

    menu();

    break;

    case 'b':

    billGenerate();

    break;

    default:

    printf("wrong Choice...!!!!");

    break;

    }

    }

    }

    void menu()

    {

    clrscr();

  • 8/8/2019 Term PaperC

    10/22

    printf("*********MENU***********");

    printf("\nITEM PRICE");

    printf("\n\n\n\n1.Veg Burger 45 /-");

    printf("\n2.Noodles 80 /-");

    printf("\n3.Veg Pizza 120 /-");

    printf("\n4.Cheez Pizza 160 /-");

    printf("\n5.Cheez Chilly 180 /-");

    printf("\n6.Spring Role 120 /-");

    printf("\n7. French Fries 90 /-");

    printf("\n8. Grilled Sandwich 120 /-");

    printf("\n9.Manchurian 120 /-");

    printf("\n---Bevrages--------------");

    printf("\n1. Aerated Water: 30");

    printf("\n2.Coffe 30");

    printf("\n3Cold Coffee 50");

    printf("\nShakes 60");

    printf("\n\n\n\n\n\nPRESS ANY KEY TO CONTINUE.!!!!!!!!");

    getch();

    }

    void billGenerate()

    {

    char iChoice,cCustName[50];

    int iCode,iTotalBill=0,iQuantity=0;

  • 8/8/2019 Term PaperC

    11/22

    printf("\n\nPlease enter the name of customer whose");

    scanf("%s",cCustName);

    clrscr();

    printf("\n*************Please choose From Following

    Codes************");

    while(iChoice!='e')

    {

    printf("\n\nITEM NAME ITEM CODE");

    printf("\n\n\n\nVeg Burger 1 ");

    printf("\nNoodles 2");

    printf("\nVeg Pizza 3");

    printf("\nCheez Pizza 4");

    printf("\nCheez Chilly 5");

    printf("\nSpring Role 6");

    printf("\nFrench Fries 7");

    printf("\nGrilled Sandwich 8");

    printf("\nManchurian 9");

    printf("\nAerated Water: 10");

    printf("\nCoffee 11");

    printf("\nCold Coffee 12");

    printf("\nShakes 13");

    printf("\n\n\n\n Enter 14 To calculate Bill");

    printf("\n\n Enter 15 To Calculate Bill Of New Customer");

  • 8/8/2019 Term PaperC

    12/22

    scanf("%d",&iCode);

    switch(iCode)

    {

    case 1:

    printf("\nPlease enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*45);

    break;

    case 2:

    printf("\nPlease enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*80);

    break;

    case 3:

    printf("\nPlease enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*120);

    break;

    case 4:

    printf("\nPlease enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*160);

    break;

  • 8/8/2019 Term PaperC

    13/22

    case 5:

    printf("\nPlease enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*180);

    break;

    case 6:

    printf("\nPlease enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*120);

    break;

    case 7:

    printf("Please enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*90);

    break;

    case 8:

    printf("Please enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*120);

    break;

    case 9:

    printf("Please enter the Quantity");

    scanf("%d",&iQuantity);

  • 8/8/2019 Term PaperC

    14/22

    iTotalBill=iTotalBill+(iQuantity*120);

    break;

    case 10:

    printf("Please enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*30);

    break;

    case 11:

    printf("Please enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*30);

    break;

    case 12:

    printf("Please enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*50);

    break;

    case 13:

    printf("Please enter the Quantity");

    scanf("%d",&iQuantity);

    iTotalBill=iTotalBill+(iQuantity*60);

    break;

  • 8/8/2019 Term PaperC

    15/22

    case 14:

    clrscr();

    printf("\nTotall Bill of Mr/Ms. %s is

    %d",cCustName,iTotalBill);

    printf("\n\n\n\n\n\ Press Any Key To Continue");

    getch();

    break;

    case 15:

    iTotalBill=0;

    printf("please enter the name of customer");

    scanf("%s",cCustName);

    break;

    default:

    printf("\nWRONG CHOICE:");

    }

    printf("\n\n\n\n PRESS E TO GO TO PREVIOUS MENU...!!!!");

    scanf("%c",&iChoice);

    }

    }

  • 8/8/2019 Term PaperC

    16/22

    Future scope of Project:The program on fast food automation system using C language will

    have a significant future scope in various fast food malls. Thisprogram has a vast application in the future.

    Nowadays we see in many stores like RELIANCE FRESH and MORE

    FOR U malls, a number of workers work there and salaries are

    given to them respectively. While using this program ,the money

    that is given to the workers will be saved and there is no need for

    applying numerous workers .So the money problem as well as

    workers problem will be tackled in a sophisticated and easier

    manner. The bill problem will also get reduced.

  • 8/8/2019 Term PaperC

    17/22

    Testing:

  • 8/8/2019 Term PaperC

    18/22

  • 8/8/2019 Term PaperC

    19/22

  • 8/8/2019 Term PaperC

    20/22

  • 8/8/2019 Term PaperC

    21/22

  • 8/8/2019 Term PaperC

    22/22