Вы находитесь на странице: 1из 35

CANTEEN MANAGEMENT SYSEM

A Report on the investigatory

In Computer Science

In partial fulfillment of AISSCE-2018

Submitted by:-

Soumak Poddar

Class:- XII

AISSCE Roll No:-

Under the supervision of:-

Mr.Swarup Kr. Maity,

DAV MODEL SCHOOL, IIT, Kharagpur(WB)-721302.

2
This is to certify that Soumak Poddar, a student of class XII has
successfully completed the research on the project Canteen
Management System under the guidance of Mr.Swrup Kumar
Maity (subject teacher) during the year 2017-2018 in partial
fulfillment of Computer Science Practical examination conducted
by AISSCE, New Delhi.

___________________ ____________________
Swarup Kr. Maity
(Subject Teacher) (External Examiner)

____________________________

NK Gautam

(Principal)

3
Sl.No. Title Page No.
1. Acknowledgement 4
2. Introduction 5
3. Logic 7
4. Coding 8
5. Output 30
6. Variable Description 32
7. Function Description 33
8. Utility of the Project 34
9. Bibliography 35

4
Iwould like to express my special thanks of gratitude to my
teacher Mr.Swrup Kumar Maity who gave me the golden
opportunity to do this wonderful project on the topic Canteen
Management System, which also helped me in doing a lot of
Research and I came to know about so many new things I am
really thankful to them.
Secondly,I would also like to thank my parents and my partner
Neeraj who helped me a lot in finalizing this project within the
limited time frame.

-Soumak Poddar

5
The Company Canteen Management System is a project
developed on C++. The main Objective of the project is to provide
fast service to their companys employees by using records saved
previously. However new records can be added anytime when an
employee visits the canteen. The employee is given a Unique ID
Number which he user to have his meals and the bill of canteen is
being cut from his salary.
A canteen facility is a supplementary system that is provided by
organizations for their employees. Our canteen management
system provides a friendly User Interface for numerous food
outlets, menu design, billing features and lots more. Our
management system comprises of Vendor and Multiple Items
Management, Centralized Employee Engagement, Inventory
Management and Smart Billing system.

6
In the program the user has to enter his details if he is a new user.
He is being given a unique ID number which he has to remember
when he enters into the canteen. If he is a old user then he can log
onto his canteen account by typing his name and Unique ID
number. He is being displayed the set of menus for that day and
he can select amongst them the available items with their
quantity. His bill will be charged from his salary. If he is the
companys employee he will get some discount too. Graphics has
been used throughout to make the program attractive visually and
interesting.

7
//including the header files

#include<fstream.h>

#include<graphics.h>

#include<dos.h>

#include<conio.h>

#include<process.h>

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include<iomanip.h>

//declaring global variables

ifstream fin;

ofstream fout;

int mx,my,d,m,x=0;

char item[25][100],b[25][100],ur[2];

int a=0;

int z;

char ic[20];int l=0;

8
//declaring the function prototype

void newuser();

void exisuser();

void border();

void cms();

void welcome(char []);

void spage();

void dev();

void getoption();

void menu();

void bill(char m[][100],char p[][100],int pr[],char ch);

void dispbill(char item[][100],char pq[][100],int amt,int q[]);

void initgraphics();

//declaration of the class

class emp

public:

char ename[30];

char ecode[30],eaddr[30];

int eage;

float ebasic;

int eid;

void insert() //accepting the users details

9
cout<<setw(5)<<"\nEnter Your Name : ";

gets(ename);

cout<<setw(5)<<"\nEnter Your Address : ";

gets(eaddr);

cout<<setw(5)<<"\nEnter Your Code : ";

gets(ecode);

cout<<setw(5)<<"\nEnter Your Age : ";

cin>>eage;

cout<<setw(5)<<"\nEnter Your Basic Pay : ";

cin>>ebasic;

eid=random(500)+1000;

}E;

void main() //declaration of main method

initgraphics();

cms();

dev();

spage();

getoption();

void initgraphics() //declaration and detection of graphics folders

d=DETECT;

10
initgraph(&d,&m,"..//bgi");

mx=getmaxx();

my=getmaxy();

void cms() //setting the front/welcome screen graphics

setbkcolor(7);

setcolor(15);

settextstyle(SANS_SERIF_FONT,0,5);

settextstyle(7,0,7);

moveto(160,100);

outtext("CANTEEN");

moveto(70,210);

outtext("MANAGEMENT ");

moveto(160,320);

outtext("SYSTEM");

delay(1000);

setcolor(7);

int i=0;

while(i<=2*getmaxx()-460)

line(0,i,i,0);

i++;

delay(15);

11
}

cleardevice();

closegraph();

void dev() //setting the second screen graphics

clrscr();

for(int x=50;x>=20;x--)

textcolor(RED);

delay(160);

gotoxy(x,12);

cputs(" P R O J E C T ");

gotoxy(x,14);

cputs(" D E V E L O P E D B Y : ");

gotoxy(x,16);

cputs("A.NEERAJ AND SOUMAK PODDAR ");

gotoxy(x,24);

cputs("PRESS ANY KEY TO CONTINUE");

getch();

void spage() //setting the welcome screen graphics

12
initgraphics();

setbkcolor(0);

delay(1000);

setcolor(RED);

settextstyle(4,0,6);

outtextxy(200,50,"WELCOME"); delay(1000);

settextstyle(4,0,6);

setcolor(BLUE);

outtextxy(290,170,"TO"); delay(1000);

setcolor(WHITE);

settextstyle(5,0,5);

for(int i=-225,j=639;i<71;i++,j--)

outtextxy(i,300,"TECHNXT"); outtextxy(j,300,"CANTEEN");

delay(15); setcolor(BLACK);

outtextxy(i,300,"TECHNXT"); outtextxy(j,300,"CANTEEN");

setcolor(WHITE);

outtextxy(70,300,"TECHNXT");

outtextxy(j,300,"CANTEEN"); delay(1000);

i=1;

setbkcolor(BLACK);

do

13
setcolor(i);

settextstyle(4,0,6);

outtextxy(200,50,"WELCOME"); delay(100);

settextstyle(7,0,6);

setcolor(i+1);

outtextxy(290,170,"TO"); delay(100);

setcolor(i+3);

settextstyle(5,0,5);

outtextxy(70,300,"TECHNXT");

outtextxy(j,300,"CANTEEN"); delay(100);

i++;

}while(i!=13);

void border() //setting the borders of the output screen

cleardevice();

setcolor(GREEN);

rectangle(2,2,mx-2,my-2);

setcolor(RED);

rectangle(4,4,mx-4,my-4);

setcolor(GREEN);

rectangle(6,6,mx-6,my-6);

setcolor(15);

settextstyle(1,0,5);

14
outtextxy(110,40,"TECHNXT CANTEEN");

setcolor(YELLOW);

line(110,88,525,88);

setcolor(RED);

line(110,90,525,90);

void getoption()

border();

setcolor(YELLOW);

settextstyle(5,0,5);

outtextxy(10,170,"1. NEW USER");

outtextxy(10,220,"2. EXISTING USER");

outtextxy(10,270,"3. EXIT");

int go=getch();

cleardevice();

border();

if(go=='1')

newuser();

else if(go=='2')

exisuser();

else if(go=='3')

exit(0);

else

15
getoption();

void newuser() //a function to accept the details of a new user

clrscr();

cleardevice();

border();

randomize();

fout.open("Employee.dat",ios::app|ios::binary);

gotoxy(25,8);

E.insert();

fout.write((char*)&E,sizeof(E));

clrscr();

cleardevice();

border();

gotoxy(5,10);

cout<<"Your ID is : "<<E.eid;

cout<<"\nPlease remember this ID because you'll get access to Canteen using this
ID"<<"\n";

gotoxy(25,25);

cout<<"PRESS ANY KEY TO CONTINUE";

getch();

getoption();

fout.close();

16
}

void exisuser() //checking the details of existing user

char name[30];

int id;

gotoxy(5,8);

cout<<"\nEnter Your Name : ";

gets(name);

cout<<"\nEnter Your ID : ";

cin>>id;

fin.open("Employee.dat",ios::in|ios::binary);

while(fin.read((char*)&E,sizeof(E)))

if((strcmp(E.ename,name)==0)&&E.eid==id)

break;

else if((strcmp(E.ename,name)==0)&&E.eid!=id)

clrscr();

border();

setcolor(WHITE);

gotoxy(10,8);

settextstyle(1,0,3);

outtextxy(75,200,"Sorry! The entered name and ID do not match");

gotoxy(25,25);

17
cout<<"PRESS ANY KEY TO CONTINUE";

getch();

getoption();

else

clrscr();

border();

setcolor(WHITE);

settextstyle(1,0,3);

outtextxy(150,200,"Sorry! Record Not Found!!!");

gotoxy(25,25);

cout<<"PRESS ANY KEY TO CONTINUE";

getch();

getoption();

welcome(name);

void welcome(char name[]) //calling the menu display screen

cleardevice();

border();

setcolor(WHITE);

18
settextstyle(1,0,5);

outtextxy(180,140,"WELCOME");

setcolor(RED);

settextstyle(1,0,5);

outtextxy(220,180,name);

settextstyle(1,0,4);

setcolor(RED);

outtextxy(10,360,"PRESS ANY KEY TO SEE THE MENU");

getch();

cleardevice();

menu();

void items(char m[][100],char p[][100],int pr[],int c) //displaying the menus

if(c=='1')

char m1[][100]={"MILK TEA","BLACK COFFEE","MILK","CREAM


COFFEE","GINGER TEA","GREEN TEA"};

char p1[][100]={"10","20","20","30","15","20"};

int pr1[]={10,20,20,30,15,20};

for(int i=0;i<6;i++)

strcpy(m[i],m1[i]);

strcpy(p[i],p1[i]);

19
pr[i]=pr1[i];

else if(c=='2')

char m1[][100]={"COKE","SPRITE","LEMON SODA","1 LTR. WATER


BOTTLE","FANTA","LASSI"};

char p1[][100]={"15","20","20","20","50","60"};

int pr1[]={15,20,20,20,50,60};

for(int i=0;i<6;i++)

strcpy(m[i],m1[i]);

strcpy(p[i],p1[i]);

pr[i]=pr1[i];

else if(c=='3')

char m1[][100]={"ALOO PARATHA","BUTTER BREAD","EGG


BREAD","IDLI","UPMA","DOSA"};

char p1[][100]={"15","25","50","20","20","20"};

int pr1[]={15,25,50,20,20,20};

for(int i=0;i<6;i++)

20
strcpy(m[i],m1[i]);

strcpy(p[i],p1[i]);

pr[i]=pr1[i];

else if(c=='4')

char m1[][100]={"FRIED RICE","PLAIN RICE","BIRIYANI","CHILLI


CHICKEN","MATAR PANEER","EXTRA CHAPATI"};

char p1[][100]={"60","50","40","40","50","5"};

int pr1[]={60,50,40,40,50,5};

for(int i=0;i<6;i++)

strcpy(m[i],m1[i]);

strcpy(p[i],p1[i]);

pr[i]=pr1[i];

else if(c=='5')

char m1[][100]={"VEG. NOODLES","EGG/CHICKEN ROLL","BLACK FOREST


CAKE","EGG LESS CAKE","VEG BURGER","PIZZA"};

char p1[][100]={"40","231","238","252","30","20"};

int pr1[]={40,231,238,252,30,20};

21
for(int i=0;i<6;i++)

strcpy(m[i],m1[i]);

strcpy(p[i],p1[i]);

pr[i]=pr1[i];

char dispmenu()

border();

char cat;

setcolor(WHITE);

settextstyle(1,0,5);

outtextxy(225,100,"MENU");

setcolor(YELLOW);

settextstyle(1,0,4);

outtextxy(10,170,"1. HOT DRINKS");

outtextxy(10,200,"2. COLD DRINKS");

outtextxy(10,230,"3. MORNING SNACKS");

outtextxy(10,260,"4. LUNCH");

outtextxy(10,290,"5. EVENING SNACKS");

outtextxy(10,320,"0. EXIT");

cat=getch();

22
if(cat=='0')

exit(0);

else

return(cat);

void menu() //accepting the quantity required

char c=dispmenu();

char m[100][100];

char p[100][100];

int pr[100];

char ch;

if(c=='1'||c=='2'||c=='3'||c=='4'||c=='5')

items(m,p,pr,c);

else

menu();

start:

cleardevice();

border();

settextstyle(1,0,2);

setcolor(CYAN);

outtextxy(10,100,"ITEMS");

23
outtextxy(500,100,"PRICE");

line(10,130,80,130);

line(500,130,570,130);

settextstyle(0,0,2);

for(int i=0,y=140;i<6;i++,y+=30)

ur[0]=(char)(i+49);

ur[1]='.';

outtextxy(10,y,ur);

outtextxy(25,y,m[i]);

outtextxy(510,y,p[i]);

outtextxy(60,360,"PRESS 0 TO SEE THE MAIN MENU");

outtextxy(60,400,"PRESS Q TO EXIT");

ch=getch();

if(ch=='Q'||ch=='q')

exit(0);

else if(ch=='0')

menu();

else if(ch!='1'&&ch!='2'&&ch!='3'&&ch!='4'&&ch!='5'&&ch!='6')

goto start;

else

bill(m,p,pr,ch);

24
void bill(char m[][100],char p[][100],int pr[],char ch) //displaying the bill

int qty[100];char c;

strcpy(item[x],m[ch-49]);

strcpy(b[x],p[ch-49]);

cleardevice();

border();

settextstyle(1,0,2);

outtextxy(30,100,"SELECTED ITEM IS : ");

outtextxy(100,150,m[ch-49]);

textcolor(2);

gotoxy(10,15);

cout<<"Enter the quantity of items you want to purchase : ";

cin>>qty[x];

a=a+pr[ch-49]*qty[x];

here:

cleardevice();

border();

settextstyle(1,0,2);

outtextxy(10,300,"PRESS 1 TO BUY FROM SAME CATEGORY");

outtextxy(10,360,"PRESS 2 TO BUY FROM ANOTHER CATEGORY");

outtextxy(10,400,"PRESS B TO DISPLAY BILL AND EXIT");

c=getch();

x++;

25
if(c=='1')

start:

cleardevice();

border();

ur[0]='\0';

setcolor(CYAN);

settextstyle(1,0,2);

outtextxy(10,100,"ITEMS");

outtextxy(500,100,"PRICE");

line(10,130,80,130);

line(500,130,570,130);

settextstyle(0,0,2);

for(int i=0,y=140;i<6;i++,y+=30)

ur[0]=i+49;

ur[1]='.';

outtextxy(10,y,ur);

outtextxy(25,y,m[i]);

outtextxy(510,y,p[i]);

outtextxy(60,360,"PRESS 0 TO SEE THE MAIN MENU");

outtextxy(60,400,"PRESS Q TO EXIT");

ch=getch();

26
if(ch=='Q'||ch=='q')

exit(0);

else if(ch=='0')

menu();

else if(ch!='1'&&ch!='2'&&ch!='3'&&ch!='4'&&ch!='5'&&ch!='6')

goto start;

else

bill(m,p,pr,ch);

else if(c=='B'||c=='b')

cleardevice();

dispbill(item,b,a,qty);

else if(c=='2')

menu();

else

goto here;

void dispbill(char item[][100],char pq[][100],int amt,int q[]) //setting the bill page

cleardevice();

border();

setbkcolor(7);

27
setcolor(RED);

settextstyle(1,0,3);

outtextxy(10,100,"ITEMS");

outtextxy(500,100,"PRICE");

outtextxy(250,100,"QUANTITY");

line(10,130,80,130);

line(250,130,350,130);

line(500,130,570,130);

settextstyle(1,0,2);

for(int i=0,y=140;i<x;i++,y+=30)

l=0;

while(q[i]!=0)

z=q[i]%10;

ic[l]=(char)(z+48);

l++;

q[i]=q[i]/10;

ic[l]='\0';

outtextxy(10,y,item[i]);

outtextxy(260,y,ic);

outtextxy(510,y,pq[i]);

28
gotoxy(5,20);

cout<<"TOTAL : "<<amt;

setcolor(BROWN);

settextstyle(0,0,2);

outtextxy(60,360,"THANK YOU! VISIT AGAIN!!!");

outtextxy(60,400,"PRESS ANY KEY TO EXIT");

getch();

exit(0);

}//end of program

/*developed and designed by

A Neeraj and Soumak Poddar*/

29
30
31
Variable Name Data Type Description
Mx Integer Used in Graphics implement.
My Integer Used in Graphics implement.
D Integer Used in Graphics implement.
M Integer Used in Graphics implement.
L Integer Used as a counter.
X Integer Used in Graphics implement.
Count Integer User as item counter.
Item Char Used to store the menus available.
B Char Used to store the different menu
timings.
Ur Char Used to store employees menu
choice.
ecode Char Used to store the employee code.
ename Char Used to store the name of employee.
Ebasic Float Used to store the basic pay of
employee.
eaddr Char Used to store the address of
employee.
eage Integer Used to store the age of employee.

32
Function Return Description
Name Type
Newuser() Void Used to enter the details of new user.
Exisuser() Void Used to check the details of existing
user.
Border() Void Used to draw and design the borders.
Cms() Void Used to draw and design the first
screen of the program.
Welcome() Void Used to draw and design the
welcome screen.
Spage() Void Used to draw and design the
frontline screen.
Dev() Void Used to draw and design the
developers name screen.
Getoption() Void To check the user type.
Menu() Void Used to draw and design the menu
screen.
Bill() Void Used to draw and design the bil
screen.
Dispbill() Void Used to display the bill.
Initgraph() Void Used to initialize the graphics driver.

33
During the development of this project we have came across
many hurdles which I have successfully covered. Ive came to know
that how really an office canteen works. I have also come to know
about the use of Data File Handling in a program. Ive also came
to know about how to include and use graphics in C++. The
experience was really good and many things can be learnt from
this project. Its real life implementation is also very vast.

34
During the development of the project help has been taken from:-
Computer Science with C++ by Sumita Arora.
Object Oriented Programming by Robert Lafore.
Scribd.com
Google.com

35

Вам также может понравиться