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 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. 1. 2. 3. 4. 5. 6. 7. 8.
Title Acknowledgement Acknowledgement Introduction Logic Coding Output Variable Description Description Function Description Description Utility of the Project
Page No. 4 5 7 8 30 32 33 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 company’s employees company’s 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 facility is a supplementary supplementary system 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 company’s employee company’s 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
#include #include #include #include #include #include #include #include //declaring global variables
ifstream fin; ofstream fout; int mx,my,d,m,x=0; mx,my,d,m,x=0; char item[25][100],b[25][10 item[25][100],b[25][100],ur[2]; 0],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
user’s details
{ 9
cout<
: ";
gets(ename); cout<
: ";
gets(ecode); cout<
: ";
cin>>eage; cout<>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 outtext("MANAGEM ENT "); 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--) x=50;x>=20;x--) { textcolor(RED); delay(160); gotoxy(x,12); cputs(" P R O J E C T "); gotoxy(x,14); cputs(" 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"); outtextxy(200,50,"WELCOME"); delay(1000); settextstyle(4,0,6); setcolor(BLUE); outtextxy(290,170,"TO"); outtextxy(290,170,"TO"); delay(1000); setcolor(WHITE); settextstyle(5,0,5); for(int i=-225,j=639;i<71;i++,j--) i=-225,j=639;i<71;i++,j--) { outtextxy(i,300,"TECHNXT"); outtextxy(i,300,"TEC HNXT"); outtextxy(j,300,"CANT outtextxy(j,300,"CANTEEN"); EEN"); delay(15); setcolor(BLACK); outtextxy(i,300,"TECHNXT"); outtextxy(i,300,"TEC HNXT"); outtextxy(j,300,"CANT outtextxy(j,300,"CANTEEN"); EEN"); setcolor(WHITE); } outtextxy(70,300,"TECHNXT"); outtextxy(j,300,"CANTEEN"); outtextxy(j,300,"CANTEEN"); delay(1000); i=1; setbkcolor(BLACK); do { 13
setcolor(i); settextstyle(4,0,6); outtextxy(200,50,"WELCOME"); outtextxy(200,50,"WELCOME"); delay(100); settextstyle(7,0,6); setcolor(i+1); outtextxy(290,170,"TO"); outtextxy(290,170,"TO"); delay(100); setcolor(i+3); settextstyle(5,0,5); outtextxy(70,300,"TECHNXT"); outtextxy(j,300,"CANTEEN"); 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 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. outtextxy(10,170,"1. NEW USER"); outtextxy(10,220,"2. outtextxy(10,220,"2. EXISTING USER"); outtextxy(10,270,"3. 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 : "<
} 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 if((strcmp(E.ename,name)==0)&&E.eid!=id) .eid!=id) { clrscr(); border(); setcolor(WHITE); gotoxy(10,8); settextstyle(1,0,3); outtextxy(75,200,"Sorry! 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! 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 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","MILK","CREAM COFFEE","GINGER TEA","GREEN TEA"}; char p1[][100]={"10","20","20 p1[][100]={"10","20","20","30","15","20"}; ","30","15","20"}; int pr1[]={10,20,20,30,15,20}; 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 p1[][100]={"15","20","20","20","50","60"}; ","20","50","60"}; int pr1[]={15,20,20,20,50,60}; pr1[]={15,20,20,20,50,60}; for(int i=0;i<6;i++) 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 p1[][100]={"15","25","50","20","20","20"}; ","20","20","20"}; int pr1[]={15,25,50,20,20,20}; pr1[]={15,25,50,20,20,20}; for(int i=0;i<6;i++) 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 p1[][100]={"60","50","40","40","50","5"}; ","40","50","5"}; int pr1[]={60,50,40,40,50,5}; pr1[]={60,50,40,40,50,5}; for(int i=0;i<6;i++) 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","23 p1[][100]={"40","231","238","252","30","20 8","252","30","20"}; "}; int pr1[]={40,231,238,252,30,20} pr1[]={40,231,238,252,30,20};;
21
for(int i=0;i<6;i++) 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. outtextxy(10,170,"1. HOT DRINKS"); outtextxy(10,200,"2. outtextxy(10,200,"2. COLD DRINKS"); outtextxy(10,230,"3. outtextxy(10,230,"3. MORNING SNACKS"); outtextxy(10,260,"4. outtextxy(10,260,"4. LUNCH"); outtextxy(10,290,"5. outtextxy(10,290,"5. EVENING SNACKS"); outtextxy(10,320,"0. 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+=3 i=0,y=140;i<6;i++,y+=30) 0) { 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 outtextxy(60,360,"PRESS 0 TO SEE THE MAIN MENU"); outtextxy(60,400,"PRESS 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'&& if(ch!='1'&&ch!='2'&&ch!='3'&&ch!='4'&&ch!='5'&&ch!='6') 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 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 outtextxy(10,300,"PRESS 1 TO BUY FROM SAME CATEGORY"); outtextxy(10,360,"PRESS outtextxy(10,360,"PRESS 2 TO BUY FROM ANOTHER CATEGORY"); outtextxy(10,400,"PRESS 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 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 outtextxy(60,360,"PRESS 0 TO SEE THE MAIN MENU"); outtextxy(60,400,"PRESS 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! if(ch!='1'&&ch!='2'&&ch!='3'&&ch!='4'&&ch!='5'&&ch!='6') ='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[]) { cleardevice(); border(); setbkcolor(7); 27
//setting the bill page
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
gotoxy(5,20); cout<<"TOTAL : "<
29
30
31
Variable Name
Data Type
Description
Mx My
Integer Integer
Used in Graphics implement. Used in Graphics implement.
D
Integer
Used in Graphics implement.
M L X
Integer Integer Integer
Used in Graphics implement. Used as a counter. Used in Graphics implement.
Count Item B
Integer Char Char
Ur
Char
ecode ename
Char Char
User as item counter. Used to store the menus available. Used to store the different menu timings. Used to store employee’s menu employee’s menu choice. Used to store the employee code. Used to store the name of employee.
Ebasic
Float
eaddr
Char
eage
Integer
Used to store the basic pay of employee. Used to store the address of employee. Used to store the age of employee.
32
Function Name
Return Type
Description
Newuser() Exisuser()
Void Void
Border()
Void
Used to enter the details of new user. Used to check the details of existing user. Used to draw and design the borders.
Cms()
Void
Welcome()
Void
Spage()
Void
Dev()
Void
Getoption() Menu()
Void Void
Bill()
Void
Dispbill() Initgraph()
Void Void
Used to draw and design the first screen of the program. Used to draw and design the welcome screen. Used to draw and design the frontline screen. Used to draw and design the developers name screen. To check the user type. Used to draw and design the menu screen. Used to draw and design the bil screen. Used to display the bill. Used to initialize the graphics driver.
33
During the development of this project we have came across I’ve came to know many hurdles which I have successfully covered. I’ve came that how really an office canteen works. I have also come to know I’ve also came about the use of Data File Handling in a program. I’ve also 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