bill book restaurant
TRANSCRIPT
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 1/22
Term paper
Of Foundations of computing
Fast food automation system
Submitted by:
pratik sinha
k38e5 a15
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 2/22
Table of contents:
1. Introduction
2. Proposed system
(a) Description
(b) System requirements
3. Requirement analysis4. System design
5. Source code
6. Testing
7. Future scope of the project
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 3/22
Introduction:Fast food automation system is a program based on C language. Generally ,in
various 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 workersas 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
(b) System requirements:
PC (RAM): 256 MB
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 4/22
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. For
example, 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
Basic data types (integer and character)
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 5/22
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
switch (expression) statement
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 6/22
The statement statement is typically a compound statement (i.e. a block of
statements enclosed in braces). The branched-to statement is determined by
evaluating 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)
{
printf("Hello, %s.", name);
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 7/22
}
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
2. Press B to see generate bill
3. Press E to exit
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 8/22
4. Press any key to continue
Source code:
Program on Fast Food
Automation System
#include<stdio.h>
#include<conio.h>
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");
printf("\n\n B. To See Generate Bill");
printf("\n\n E. To Exit");
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 9/22
cChoice=getch();
//scanf("%c",&cChoice);
switch(cChoice)
{
case 'm':
menu();
break;
case 'b':
billGenerate();
break;
default:
printf("wrong Choice...!!!!");
break;
}
}
}
void menu()
{
clrscr();
printf("*********MENU***********");
printf("\nITEM PRICE");
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 10/22
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;
printf("\n\nPlease enter the name of customer whose");
scanf("%s",cCustName);
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 11/22
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");
scanf("%d",&iCode);
switch(iCode)
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 12/22
{
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;
case 5:
printf("\nPlease enter the Quantity");
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 13/22
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);
iTotalBill=iTotalBill+(iQuantity*120);
break;
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 14/22
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;
case 14:
clrscr();
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 15/22
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);
}
}
Future scope of Project:
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 16/22
The program on fast food automation system using C language will
have a significant future scope in various fast food malls. This
program 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.
Testing:
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 17/22
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 18/22
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 19/22
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 20/22
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 21/22
5/16/2018 Bill Book Restaurant - slidepdf.com
http://slidepdf.com/reader/full/bill-book-restaurant 22/22