Post on 14-Apr-2018
7/27/2019 Fast food automation system.doc
1/33
Term paper -Foundations of
computing
FAST FOOD AUTOMATION
SYSTEM
Submitted to: Submitted by:
Table of contents:1
7/27/2019 Fast food automation system.doc
2/33
1. Acknowledgement
2. Introduction
3. Proposed system
(a)Description
(b)System requirements
4. Requirement analysis
5. System design
6. Source code
7. Testing
8. Future scope
9. Bibliography
2
7/27/2019 Fast food automation system.doc
3/33
AKNOWLEDGEMENT
As usual large number of people deserves my thanks for the help they provided
me for the preparation for this term paper.
First of all i would like to thanks my teachers and for their supportduring the preparation of this topic . I am very thankful for their guidance.
I would also like to thank my friends for the encouragement and
information about the topic they provided to me during to me during my effort to
prepare this topic.
3
7/27/2019 Fast food automation system.doc
4/33
INTRODUCTIONFast 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 workers
is reduced and management of money becomes very easy. 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 emergeand 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 superseded by languages like C++, C# and JAVA.
This project is a program on fast food automation system using C language.
PROPOSED SYSTEM:(a) Description:
Windows XP professional
4
7/27/2019 Fast food automation system.doc
5/33
Microsoft windows
(b) System requirements:
PC (RAM): 256 MB
LAPTOP (RAM): 1 GB
REQUIREMENT
ANALYSIS:
Keywords
Keywords are identifiers reserved by the language for special use.That is
we can say that keywords are certain identifiers which have predefined
meanings and cannot be redefined .There are 32 keywords whose meaning
has been explained to C complier. These are always written in lower case.
Only the exact spelling of keywords is reserved.
For example, auto is reserved but AUTO is not.
5
7/27/2019 Fast food automation system.doc
6/33
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.
Syntax-
break;
Int ,char
Basic data types (integer and character)
Int i.e. integer type variables are used to store whole numbers without a
fractional part. They can be:
Signed (default) range is from -32768 to 32767
Unsigned- range is from 0 to 65535
But this default may be changed if compiler option 'mnoshort' is given.
i.e
Signed- the rang is from -2147483648 to 2147483647,
Unsigned- the range is from 0 to 4294967295.
6
7/27/2019 Fast food automation system.doc
7/33
Variables of type char are 1 byte in length. They can be:
Signed (this is the default) range is -128 to 127
Unsigned char or unsigned range 0 to 255
All data types may be used for defining variables, specifying return types
of functions, and specifying types of function arguments.
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 languagemay have an arbitrary level of complexity.
Switch case, and default
Switch statement is a multi-way decision making statement which selects
one of the several alternatives based on the value of integer variable or
expression.
Syntax:
switch (expression) statement
When the switch statement is executed then the expression is evaluated
and control is transferred directly to group of statements whose case-label
matches the value of the expression. A case-label consists of the case
keyword by a constant value that is the value which will select the case
7
7/27/2019 Fast food automation system.doc
8/33
followed by a colon. The value of expression is compared with each of the
case-labels (integer/character constants) in the order they appear in the switch
statement.
FLOW CHART OF SWITCH STATEMENT:
8
7/27/2019 Fast food automation system.doc
9/33
TRUE
FALSE
TRUE
FALSE
9
SWITCH
VARIABLE
EQUALS
1ST CASE-
CONSTANT
SWITCH
VARIABLE
EQUALS
2ND CASE-
CONSTANT
FIRST CASE
BODY
SECOND CASE
BODY
7/27/2019 Fast food automation system.doc
10/33
If no match occurs with any of the case then only the statement(s)
following the default are executed. The default part is optional in the switch
statement. I.e.
Default: execution continues at this point. Otherwise, statement is skippedentirely.
Each case can contain zero, one or more program statements. Unlike
other control structures the block of statements corresponding to a case are
not required to be enclosed in curly braces.
VoidEmpty data type.
When used as a function return type, void means that the function does
not return a value. For example,
10
DEFAULT
BODY
NEXT
STATEMENT
7/27/2019 Fast food automation system.doc
11/33
void hello (char *name)
{
printf("Hello, %s.", name);
}
When found in a function heading, void means the function does not take
any parameters..
While
It repeats execution while the condition is true. Keyword while is themost general loop statements.
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++;
11
Entry
7/27/2019 Fast food automation system.doc
12/33
FALSE
TRUE
12
Test
Expression
Body of
loop
Next
statement
7/27/2019 Fast food automation system.doc
13/33
Functions
A function is a self contained block of statements enclosed between braces thatperforms a specific task. It groups a number of repeated statements in a program
into a single unit and is identified by a name known as afunction name.
A program can contain one or more functions, but the main() function must be
a part of every program. It is the main() function from which the programs
execution begins. Other additional functions must be subordinate to it and to one
another.
Every function in C consists of following components:
Function definition
Function declaration or Function prototype
Function call
Function definition: It is the part of function where the actual contents of thefunction are defined. It basically consists of first line which contains data type of the
value to returned followed by name of the function and then the arguments enclosed
in pair of parantheses.
Syntax:
Ret_type func_name(data_type par1, data_type par2,..) function
{ header
Local variable declaration:
statement;
13
7/27/2019 Fast food automation system.doc
14/33
................
....
return(expression);
}
Function declaration: It specifies the name of the function , number andtype of parameters and its return type. The syntax of function declaration is similar
to that of function definition , the only difference that exists is that a function
declaration ends with a semicolon.
Syntax
Data_type func_name(type1, type2,..typeN);
Function call: A declared function needs to be used somewhere in theprogram, so we need to call it. A function can be called by specifying the function
name followed by a list of arguments separated by commas enclosed in a pair of
parentheses. Each function call is terminated by a semicolon. If no argument is
required then there must be an empty pair of parentheses.
Example:
Argument
function call Func1( x ); semicolon
Function nam
SYSTEM DESIGN:Please choose from the following:
14
7/27/2019 Fast food automation system.doc
15/33
(a) Press M to see the menu
(b) Press B to see generate bill
(c) Press E to exit
(d) Press any key to continue
15
WELCOME TO THE MAIN
MENU
ENTE
R
CHOIC
E
PLACE
ORDER
BILL EXIT
DO YOU
WANT TO
CONTINUE
CONTINUE
START
STOP
7/27/2019 Fast food automation system.doc
16/33
SOURCE CODE:
Program on FastFood
Automation
System#include
#include
void menu();
void billGenerate();
void main()
{
char cChoice;
int i,j,k,n;
16
7/27/2019 Fast food automation system.doc
17/33
textbackground(7);
clrscr();
gotoxy(34,8);
textcolor(11);
cprintf("welcome");
delay(5);
for(i=0;i
7/27/2019 Fast food automation system.doc
18/33
}
if(i==5)
{ gotoxy(32,16);
cprintf("Loading PRICES..........");
}
if(i==6)
{ gotoxy(32,16);
cprintf("Loading GENERATOR.......");
}
if(i==7)
{ gotoxy(32,16);
cprintf("Loading system..........");
}
for(k=12;k
7/27/2019 Fast food automation system.doc
19/33
while(cChoice!='e')
{
textcolor(4);
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");
cChoice=getch();
switch(cChoice)
{
case 'm':
menu();
break;
case 'b':
billGenerate();
break;
default:
printf("wrong Choice...!!!!");
break;
}
19
7/27/2019 Fast food automation system.doc
20/33
}
}
void menu()
{
textcolor(4);
clrscr();
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");
20
7/27/2019 Fast food automation system.doc
21/33
printf("\n\n\n\n\n\nPRESS ANY KEY TO CONTINUE.!!!!!!!!");
getch();
}
void billGenerate()
{
char iChoice,cCustName[50];
int t,iCode,iTotalBill=0,iQuantity=0;
printf("\n\nPlease enter the name of customer whose");
scanf("%s",cCustName);
textbackground(1);
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");
21
7/27/2019 Fast food automation system.doc
22/33
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\n\n");
scanf("%d",&iCode);
printf("Enter the product code");
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:
22
7/27/2019 Fast food automation system.doc
23/33
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");
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);
23
7/27/2019 Fast food automation system.doc
24/33
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;
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");
24
7/27/2019 Fast food automation system.doc
25/33
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:
textbackground(9);
clrscr();
for(t=1;t
7/27/2019 Fast food automation system.doc
26/33
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);
}
}
TESTING:
26
7/27/2019 Fast food automation system.doc
27/33
27
7/27/2019 Fast food automation system.doc
28/33
28
7/27/2019 Fast food automation system.doc
29/33
29
7/27/2019 Fast food automation system.doc
30/33
30
7/27/2019 Fast food automation system.doc
31/33
31
7/27/2019 Fast food automation system.doc
32/33
32
7/27/2019 Fast food automation system.doc
33/33
FUTURE SCOPE:
The program on fast food automation system using Clanguage 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 andeasier manner. The bill problem will also get reduced.
BIBLIOGRAPHY:
Programming with C Byron SGottfried
Learn programming in C Kamaljeet
Kaur
Let us C- Yashwant Kanitkar