You are on page 1of 59




Rushell¶s Restaurant, an imaginary restraunt made familiar by Rushell Chopra for his class 12 board C++ practicals.

A restaurant is a retail establishment that serves prepared food to customers Service is generally for eating on premises, though the term has been used to describe take-out establishments and food delivery services. The term covers many types of venues and a diversity of styles of cuisine and service. A restaurant owner is called a restaurateur; both words derive from the French verb restaurer, meaning to restore. ³FOOD AUTOMATION´ aims at developing into software that can be used at places like restaurants and fastfood points to easily manoeuvre the daily tasks of taking the order, calculating the bill etc. The main advantage of this project is that it converts all the manual work which is time consuming and error prone to fully automated system which helps in eliminating all the paper work, saves time, improves customer services. It also speeds up various processes such as addition of new items to the menu, deletion of items from the menu,


modification of details of items and calculation of bills thus providing convenience to the workers as well as customers.

In the development of the project , selection of an appropriate programming language and a platform is of primary importance. The major part of the credit goes to the software environment chosen by the developer. Selection of a language from the ocean of languages is very difficult , a developer has to consider various features and functionalties that a particular language can provide.

In this project c++ language is used to maintain all the data. It provides many features like file handling ,data can be easily maintained and many features that are required while doing a project.

1.1 PROBLEM DEFINITION The project is developed for restaurants , which aims to automate its various tasks. All the work of various tasks were earlier carried out manually. However in the course of time it was realized that manual work is error prone and time consuming. Automation provides quick & easy step by step approach to handle the tasks like adding items to the menu, deleting items , modifying the details of items and calculating bills. Thus automation is no longer an option , its a requirement.

y y y To reduce time for the organization To increase efficiency and accuracy of the system To reduce pressure on the labour and relieving man power from repetitive and dull job y To make the retrieval of information faster


y y y y y

To make the system more feasible To reduce large amount of paper work To make the system more reliable to avoid any ambiguity. To reduce the cost factor of the system To make the system more flexible.

Converts all the manual work which is time consuming and error prone to fully automated system Helps in eliminating all the paper work, saves time and improves customer services.

y Makes the addition of items in the menu, deletion of items and modification of
items in the menu easier and faster.

y C++ has support for most of the web servers available today y Bills can be calculated more easily and with more accuracy y Reduces pressure on the labour. y Makes the system more feasible and flexible and thus retrieval of information
becomes convenient.





y y y y



y y y y




This phase is carried out to access whether software project is technically and economically viable.

It involves following steps:-

y y y

Problem is defined Determination of technical and economical viability Study of alternative solution to attempt the problem ,a cost/benefit analysis is done.


A layout of plan is prepared to get the project executed, scope of all phases is determined.

Feasibility is the likelihood that the system will be useful to the organization.

Following feasible factors are studied during feasibility study-:

y y y y y y y

Economic and financial Technical Operational Schedule Legal and contractual Political Organizational

Economic or financial feasibility:-it is a measure of the cost effectiveness of a project or solution underline.


It is a process of evaluating how key stake holders within the organization view the proposed is a measure of specific technical solution and availability of technical resources and expertise. Political feasibility. Asserting political feasibility. ramifications due to construction of the system.contractual. It is The willingness and ability of the management . suppliers and others to operate use and support a proposed system. Legal and contractual feasibility : While asserting this we need to gain an understanding of any potential . It is also a measure of how people feel about the system/project.employees. 6 . Operational feasibility-:It is a measure of how well the solution will work in the organization.The construction of an IS can have potential ramifications also. Schedule feasibility-:It is a measure of how responsible the project time-table is.Technical feasibility-:Its purpose is to gain an understanding of the organizational ability to construct the proposed . Organizational feasibility-:It is the likelihood that the project will attain the desired objective. customers.

ADD ITEM 2. 3. MODIFY ITEM 4. We have discussed below various modules and part of project they contain. QUIT MAIN MENU It consists of the following options 1 PURCHASE 2 SEE MENU 3 EDIT MENU 4 TOTAL BILL 0 QUIT 7 .3. DELETE ITEM 3. SYSTEM DESIGN This section of the project involves the division of project in some modules or parts thus making the presentation of the project clear and easily understandable.1 MODULES (Description) This project mainly consists of two menus: y y EDIT MENU MAIN MENU Edit menu consists of the following available options: 1.

After this the complete details of the item is displayed. following details of the list of items is displayed: 1 ITEM CODE 2 ITEM NAME 3 ITEM COST 4 ITEM PRICE y Now when we choose the third option EDIT MENU following options are dislayed: 1. ADD ITEM 2. DELETE ITEM 4.e. we need to mention the item code of the item to be purchased. Then we are required to mention the quantity.e. whether we want to cancel this purchase or not y After this total bill is calculated and displayed along with the complete details of items. EXIT ENTER CHOICE: 8 . y When we choose the second option i. SEE MENU. PURCHASE. MODIFY ITEM 3.ENTER CHOICE y Now here when we choose the first option i.

Thereafter the selected item is deleted from the menu. we need to specify the item code of the item to be deleted. EXIT to exit the menu. DELETE ITEM.  When we choose the third option i.e. When we choose y our record is saved otherwise not.e. We can choose the fourth option of the main menu i.e. TOTAL BILL to display the total bill of the items purchased y 9 .e.  We can choose the fourth option i.e. MODIFY ITEM. Then we add more items according to the requirement.  Now when we choose the second option i. ADD ITEM. we need to specify the following details of the item: y y y ITEM NAME ITEM COST ITEM PRICE Thereafter we have to decide whether we want to save the record or not and hence choose one of the options: y/n. we need to specify the item code of the item to be selected and then modify the details of the items as per the requirement by choosing the correct options. Now here when we choose the first option i.

item cost and item price 2 delete item Modify item Bill is calculat ed Enter item code of the item to be Item is added Item is deleted Enter item code of the item to be modified and change the details according to the requirement Item is modified Stop 10 .2 FLOWCHART START Main menu with the given available options is displayed Total bill 1. purchase 2.see menu 3 Edit menu 0 exit Enter the item code and quantity of the item to be purchased List of items is displayed with its details such as item code. item cost etc 1 add item Total bill is calculat -ed Edit menu is displayed with certain options 0 exit Cancel the purchase Purchase is cancelled Enter the item name.3.

item cost and item price is displayed.1 WORKING In this project we have three classes: y y CLASS MENU CLASS FOOD CLASS ACCOUNT y In class menu there are two main functions: y y Edit _menu Main _menu In case of main menu we have following options: 1 PURCHASE 2 SEE MENU 3 EDIT MENU 4 TOTAL BILL 0 EXIT In case of purchase we have to mention the item code of the item to be purchased and quantity. For this we make use of see menu function 11 . For this we have purchase function When we choose see menu list of items along with its details such as item code. Thereafter bill is displayed. IMPLEMENTATION OF THE PROJECT 4.4.

This function displays the list of food items Purchase ± This function purchases the food item in the menu Last_code.This function add records in the food file. item price and item cost for the item to be added and thus the item is added in the menu In case of delete item we mention the item code of the item to be deleted .In case of Edit menu we have following options: ADD ITEM DELETE ITEM MODIFY ITEM EXIT In case of add item we mention the item name. When we choose total bill . For this we make use of modify_item and modify_record functions. In class food we have following functions: Add_item. to delete record from the food file Modify_item ±This function gives the code bill is displayed. Delete_item ± This function gives the code no. 12 .It returns the code of the last record in the food file. to modify record from the food file List_of_item. In case of modify item we mention the item code of the item to be modified.

This function sort the record in the food file according to the code nos. according to the purchases made. (FOOD. Last_billno-This function returns the billno.This function return th record no.DAT) Item_found-This function return the value 1 if the record is found for the given code in the food file . Class account is used to calculate bill.Delete_record-This function deletes the record for the given code from the food file.It consists of the following functions: Bill_list ± This function displays the lists of the bills Prepare_bill ± This function prepares and displays the bill for the given bill no.DAT) Modify_record ± This function modify the record for the given code from the food file Display_record-It displays the record of the given code from the food file(FOOD. of the given code in the food file. Recordno. of the last record in the bill file 13 . Sort.

4. private: void edit_menu(void). void modify_item(void). class food { public: void add_item(void).h> #include<stdio.h> class menu { public: void main_menu(). }.2 SOURCE CODE #include<iostream.h> #include<dos.h> #include<stdlib. void delete_item(void).h> #include<ctype.h> #include<string.h> #include<fstream.h> #include<process.h> #include<graphics.h> #include<conio. void list_of_item(void). 14 .

//THIS FUNCTION CREATES MAIN MENU AND CALLS OTHER FUNCTIONS 15 .billno.yy.float t_price). int last_billno(void).length. private: int last_code(void). void delete_record(int). private: int code. void add_bill(int. char itemname[30]. int dd. int recordno(int). int itemcode. void sort(void). }.itemprice. char name[30]. class account { public: void bill_list(void).quantity. price. void prepare_bill(int). float itemcost. void modify_record(int).void purchase(void).char *t_itemname. }. void display_record(int).int t_qty.float t_cost. float cost. int item_found(int).

cout<<"1: Purchase". gotoxy(22. cout<<"---------------------------------------".20).9).13). gotoxy(32. cout<<"---------------------------------------". while(1) { clrscr().15). ch=getche().6). cout<<"4: Total bill".7). gotoxy(35. cout<<"enter choice:". char ch.11).5). gotoxy(32. else if(ch=='1') { 16 . gotoxy(32. cout<<"3: Edit menu". cout<<"2: See menu". if(ch==27) return. cout<<"FAST FOOD". cout<<"0: Quit". gotoxy(22. gotoxy(32.17). gotoxy(32. gotoxy(32.void menu::main_menu(void) { clrscr().

a.list_of_item(). f. } } //THIS FUNCTION CREATE EDIT MENU AND CALLS OTHER //FUNCTIONS void menu::edit_menu() 17 . } else if(ch=='3') edit_menu(). else if(ch=='4') { account f. } else if(ch=='0') break. } else if(ch=='2') { food f. f.bill_list().purchase().

if(ch==27) return. cout<<"0:exit". ch=getche().6).10). char ch. cout<<"1:add item". gotoxy(32.i<=21. else if(ch=='1') { food f.14).12). ". gotoxy(32.{ clrscr(). while(1) { for(int i=5. cout<<" } gotoxy(32. gotoxy(32. 18 .7). cout<<"~~~~~~~~~~~~~~~~~~~~~".16). cout<<"3:delete item". gotoxy(32.i).i++) { gotoxy(21.19). cout<<"enter choice:". gotoxy(32. gotoxy(32. cout<<"2:modify item". cout<<"edit menu".

break.DAT". break. 19 .seekg(0. f. } else if(ch=='0') break.modify_item(). } else if(ch=='3') { food f.f. } else if(ch=='2') { food f. break.DAT) int food::last_code(void) { fstream file.ios::in).open("FOOD.delete_item().ios::beg). f. } } //THIS FUNCTION RETURNS THE CODE OF THE LAST RECORD IN //THE FOOD FILE (FOOD. file. file.add_item().

file. file. gotoxy("FOOD. cout<<"ITEM CODE ITEM NAME ITEM COST ITEM PRICE".close(). cout<<itemname. gotoxy(14.found=0.pageno=1. gotoxy(2.ios::in). int row=6. 20 . gotoxy(3. cout<<itemcode.3). found=1.row). gotoxy(30. while(file. cout<<"~~~~~~~~~~~~~~~~~". gotoxy(5.DAT". while(*)this.4).5). fstream file. } //THIS FUNCTION DISPLAYS LIST OF THE FOOD ITEMS void food::list_of_item() { clrscr().sizeof(food))) t=itemcode.2).sizeof(food))) { delay(20).read((char*)this. cout<<"LIST OF ITEMS".int t=0. return t.seekg(0).row). cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`". file.

gotoxy(32. cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~". getche(). cout<<"LIST OF ITEMS".10). } if(!found) { gotoxy(5. cout<<"ITEM CODE ITEM NAME ITEM COST ITEM COST". if(row==22) { row=5. cout<<"Press any key to continue". cout<<"=======". cout<<"\7Records not found".row). } else row++. gotoxy(66.2). clrscr().row). gotoxy(30.25). } 21 .1).5). cout<<itemprice. gotoxy(2. gotoxy(45. gotoxy(3. pageno++. gotoxy(66.4).2). gotoxy(1. cout<<"Pageno:"<<pageno. cout<<itemcost.

2). file.25).". gotoxy(5.DAT) void food::add_item(void) { int tcode.valid. gotoxy(26. cout<<"page no:"<<pageno. getche().gotoxy(66.6). } //THIS FUNCTION ADDS RECORDS IN THE FOOD FILE (FOOD.8).. 22 . char ch.close().3).1). do { clrscr().t_itemprice[10]. gotoxy(5.t_itemcost[10]. gotoxy(1. gotoxy(66. tcode++.. cout<<"Item name:".2). cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~".4). cout<<"<0>=EXIT". gotoxy(27. cout<<"===========". cout<<"ADD FOOD ITEM TO THE MENU". tcode=last_code(). gotoxy(5. gotoxy(71.10). cout<<"Itemcode:"<<tcode. cout<<"Press any key to continue.

clreol(). if((strlen(itemname)<1)||(strlen(itemname)>20)) { valid=0.clreol(). cout<<"ENTER ITEM NAME TO ADD IN THE MENU". cout<<"\7range=1.25). gotoxy(3. gotoxy(5.20". 23 . do { valid=1.cout<<"Item cost:". gotoxy(1.12). gotoxy(1. do { valid=1.25). gotoxy(5. strupr(itemname). gotoxy(1. } }while(!valid). gotoxy(3. cout<<"Item Name:".clreol().8).clreol(). gotoxy(1.clreol(). gotoxy(1. cout<<"Item price:".25).8). gets(itemname).24).24).24).clreol(). if(itemname[0]=='0') return. gotoxy(1.10). getch().

cout<<"Item cost:".12). cout<<"Item price:". gotoxy(1.25). getch(). gotoxy(3.800".25). gotoxy(1.24). } }while(!valid). cout<<"ENTER ITEM PRICE TO ADD IN THE MENU". gets(t_itemprice). gotoxy(5. if(t_itemcost[0]=='0') return. itemcost=atof(t_itemcost). itemprice=atof(t_itemprice).25).24). if(itemcost<1||itemcost>800) { valid=0. cout<<"\7Range=1. gotoxy(1. gotoxy(3. if(itemprice<itemcost||itemprice>1000) 24 .clreol(). gets(t_itemcost). gotoxy(5. if(t_itemprice[0]=='0') return.gotoxy(3.clreol().12).clreol().10). do { valid=1. cout<<"ENTER ITEM COST TO ADD IN THE MENU".

file.write((char*)this. if(ch=='0') return.17).15). 25 .1000".clreol().ios::out|ios::app). do { gotoxy(1. gotoxy(5. file.24). gotoxy(1. } }while(!valid).sizeof(food)).close(). getch(). file..clreol().24).open("FOOD.{ valid=0. } do { gotoxy(1. cout<<"\7Range="<<itemcost<<". ch=toupper(ch).clreol().. tcode++.15).DAT". fstream file.clreol(). if(ch=='Y') { itemcode=tcode. cout<<"do you want to save this record(y/n):". gotoxy(3. }while(ch!='N'&&ch!='Y').25). ch=getche(). gotoxy(1.

file. ch=getche(). if(ch=='0') return. cout<<"Item Name:"<<itemname. }while(ch!='N'&&ch!='Y').3).ios::in).ios::beg).read((char*)this. } //THIS FUNCTION DISPLAYS THE RECORD OF THE GIVEN CODE FROM //THE FOOD FILE (FOOD.sizeof(food))) { if(itemcode==tcode) { gotoxy(5. file.clreol(). gotoxy(1. gotoxy(5.DAT".4). gotoxy(5. ch=toupper(ch).25).DAT) void food::display_record(int tcode) { fstream file.gotoxy(1. gotoxy(5.clreol(). cout<<"Item Cost:"<<itemcost. }while(ch=='Y'). cout<<"DO YOU WANT TO ADD MORE RECORDS(y/n):". cout<<"Item Code:"<<"FOOD.24). while(file.17). 26 .seekg(0.5).

} } file. } }"FOOD.sizeof(food))) { if(itemcode==tcode) { found++.close(). file.6).ios::in). while(file.OF THE GIVEN CODE IN //THE FOOD FILE (FOOD. file.DAT". return found. break.DAT) int food::item_found(int tcode) { fstream file.ios::beg). cout<<"Item Price:"<<*)this.gotoxy(5. break. } //THIS FUNCTION RETURN THE RECORD NO.DAT) 27 . } //THIS FUNCTION RETURNS THE VALUE 1 IF THE RECORD IS FOUND //FOR THE GIVEN CODE IN THE FOOD FILE (FOOD. int found=0.seekg(0.close().

ios::beg).ios::beg).int food::recordno(int tcode) { fstream file. temp.ios::in). return ("FOOD.DAT". if(itemcode==tcode)"FOOD.DAT) void food::delete_record(int tcode) { fstream file.DAT".sizeof(food))) { found++. while(!file. file. int found=0. file. file.ios::out).read((char*)this.eof()) { 28 .seekg(0. } //THIS FUNCTION DELETES THE RECORD FOR THE GIVEN CODE FROM //THE FOOD FILE ( FOOD. } file. file.seekg(0.close().dat".open("temp. while(file.ios::in). fstream temp.

while(!temp.sizeof(food)).close(). char t_code[5].eof())"temp.eof()) break. 29 .seekg("FOOD.write((char*)this.close().dat".ios::in).sizeof(food)).eof()) { temp.DAT) void food::delete_item() { clrscr(). } //THIS FUNCTION GIVES THE CODE NO.ios::out). if( temp. }*)this.sizeof(food)). if(itemcode!=tcode)*)this. if(file. TO DELETE THE RECORD //FROM THE FOOD FILE (FOOD. file. temp. } file.close().DAT". file.file.sizeof(food)). temp. temp.write((char*)this.

5). t=atoi(t_code). clreol(). cout<<"Enter Item Code of the item to be deleted:". 30 . gotoxy(3. tcode=t. cout<<"Press<ENTER> to Exit". cout<<"Enter Item code of the item to be deleted:". cout<<"\7record not found". if(t_code[0]=='0') return.24). gotoxy(3. if(tcode==0) { list_of_item().3). gotoxy( t. t=atoi(t_code). gotoxy(1. if(!item_found(tcode)) { gotoxy(5.25).25).25). } clrscr(). if(tcode==0) return. gets(t_code). tcode=t. gotoxy(5. cout<<"Press<ENTER>to see the list". gets(t_code).

delete_record(tcode).8).getch(). recno=recordno(tcode). int valid. gotoxy(5. if(ch=='N') return. } display_record(tcode). do { gotoxy(1. 31 . return. } while(ch!='N'&&ch!='Y').DAT) void food::modify_record(int tcode) { int recno.t_code.8). clreol().15). cout<<"Do you want to delete this record (y/n):". ch=toupper(ch). ch=getche(). gotoxy(5. cout<<"\7Record Deleted". } //THIS FUNCTION MODIFY THE RECORD FOR THE GIVEN CODE FROM //THE FOOD FILE (FOOD. getch().

gotoxy(5. gotoxy(3.14). ch=getche().18). do { gotoxy(20. if(ch=='0') return.16).t_itemcode[5]. valid=0. gotoxy(71.12). 32 .clreol().12).12).2).t_itemprice[10].24). cout<<"Item Name:".clreol(). gotoxy(5.t_itemcost[10]. while(ch=='Y'&&!valid) { valid=1. gotoxy(1.25). gotoxy(1. cout<<"<0>=Exit". cout<<"Item Cost:". gotoxy(5.12). cout<<"Change(y/n):". gotoxy(5. cout<<"Item Price:". cout<<"Item Code:". cout<<"ENTER ITEM CODE TO ADD IN THE MENU". } while(ch!='N'&&ch!='Y').char ch.clreol(). ch=toupper(ch).clreol().25). gotoxy(1. gotoxy(5.

gets(t_itemcode). clreol(). cout<<"\7CODE ALREADY GIVEN". if(t_code==0) return. valid=0.clreol(). if(item_found(t_code)&&(t_code!=tcode)) { valid=0.14). if(ch=='0') return. ch=getche(). gotoxy(1. t_code=atoi(t_itemcode). } } do { gotoxy(20. 33 . } while(ch!='N'&&ch!='Y'). while(ch=='Y'&&!valid) { valid=1. cout<<"Change(y/n):". gotoxy(3. getch().cout<<"Item Code". ch=toupper(ch).24).14).

} while(ch!='N'&&ch!='Y'). gotoxy(3. gotoxy(5.24). strupr(itemname).14).16).clreol().20". clreol(). valid=0. ch=toupper(ch).25). ch=getche().25).gotoxy(1. if((strlen(itemname)<1)||(strlen(itemname)>20)) { valid=0. while(ch!='N'&&!valid) 34 . cout<<"\7Range=1. cout<<"change(y/n):". cout<<"ENTER ITEM NAME TO ADD IN THE MENU:".24). gets(itemname). cout<<"Item Name:".clreol(). if(ch=='0') return. gotoxy(1. } } do { gotoxy(20. getch(). gotoxy(3. if(itemname[0]=='0') return.

getch(). if(itemcost<1||itemcost>800) { valid=0. if(ch=='0') 35 .25). cout<<"change(y/n):". gotoxy(3. gotoxy(1. gotoxy(3. cout<<"Item Cost:".25). gotoxy(1. ch=toupper(ch). if(t_itemcost[0]=='0') return.24).16). cout<<"\7Range=1. itemcost=atof(t_itemcost).16). } } do { gotoxy(20. clreol().24). ch=getche(). clreol().18). cout<<"ENTER ITEM COST TO ADD IN THE MENU".{ valid=1. gotoxy(1.clreol().clreol(). gets(t_itemcost). gotoxy(5.800".

36 . gotoxy(3.25). } while(ch!='N'&&ch!='Y').return. gotoxy(1. gotoxy(1.25).21).clreol().clreol(). } } do { gotoxy(1.24). cout<<"ENTER ITEM PRICE TO ADD IN THE MENU".24).25).1000".. while(ch=='Y'&&!valid) { valid=1. itemprice=atof(t_itemprice). cout<<"Item Price". gotoxy(1.18). cout<<"\7Range="<<itemcost<<"..21).clreol(). if(itemprice<itemcost||itemprice>1000) { valid=0.clreol(). getch()..valid=0. gotoxy(3. gotoxy(5. gets(t_itemprice). gotoxy(5. if(t_itemprice[0]=='0') return. gotoxy(1.24).clreol().clreol().18). gotoxy(1.

cout<<"\7Record Modified". 37 .cout<<"Do you want to save this record(y/n):". } //THIS FUNCTION GIVES THE CODE NO. if(ch=='N'&&ch!='Y'). getch().15). if(ch=='0') getch(). file. file.close().write((char*)this. itemcode=t_code.ios::out|ios::ate). ch=getche().open("FOOD.clrscr().DAT) void food::modify_item() { clrscr(). sort(). file.DAT". ch=toupper(ch). file. gotoxy(5. if(ch=='N') return. TO MODIFY RECORD FROM //THE FOOD FILE (FOOD. char t_code[5]. location=(recno-1)*sizeof(food). fstream file.sizeof(food)). }while(ch!='N'&&ch!='Y'). int location.

if(tcode==0) return.5).clreol(). gotoxy(3. if(t_code[0]=='0') return. cout<<"Press <ENTER> to Exit". 38 . cout<<"Enter Item Code of the item to be modified:". tcode=t.25).24). cout<<"Enter Item code of the item to be modify:". t=atoi(t_code). gotoxy(3. tcode=t. if(tcode==0) { list_of_item(). gets(t_code).tcode. t=atoi(t_code). gotoxy(5. } clrscr().3). gotoxy(1. cout<<"Press <ENTER> to see the list". gotoxy(5.25). gets(t_code). if(!item_found(tcode)) { gotoxy( t.25).

getch(). modify_record(tcode).clreol(). } display_record(tcode).8).j=0 food arr[100].open("FOOD. food temp. 39 . cout<<"Do you want to Modify this record(y/n):".8).cout<<"\7Record not found". ch=getche().ios::in). }while(ch!='N'&&ch!='Y').DAT) //ACCORDING TO THE CODE NOS. gotoxy(5. do { gotoxy(1.sizeof(food)))*)&arr[i]. file.seekg(0. while(file. void food::sort() { int i=0. file. return.ios::beg).DAT". fstream file. } //THIS FUNCTION SORT THE RECORD IN THE FOOD FILE (FOOD. if(ch=='N') return. ch=toupper(ch). .

int t_billno. } } file.j<size-i. for(i=1. char t_code[5]. arr[j]=arr[j+1].i<size.write((char*)&arr[i].open("FOOD. t_billno=a. file. for(i=0.itemcode>arr[j+1]. 40 .i++) for([5].int size.close(). arr[j+1]=temp.DAT". int t.i<size.valid.last_billno().close(). } //THIS FUNCTION PURCHASES THE FOOD ITEM IN THE MENU void food::purchase() { clrscr(). int t_itemcode.i=0. t_billno++.itemcode) { temp=arr[j].j++) { if(arr[j].tcode.ios::out). size=i.purchased=0. file.i++) file. float qty.sizeof(food)). account a.

24).da_day.m1. char t_itemname[30]. return. cout<<"Enter Item Code of the item to be purchased:". cout<<"Enter Item Code of the item to be purchased:".prepare_bill(t_billno).25). cout<<"Press <ENTER>to see the list". gotoxy(1.da_mon. int d1. if(t_code[0]=='0') { if(purchased) a. 41 .25).float t_qty. gotoxy(5.3). tcode=t.da_year.clreol(). d1=d. m1=d. gotoxy(5. gets(t_code). } if(tcode==0) { list_of_item().y1.t_cost. gotoxy(3.t_price. gets(t_code). y1=d. getdate(&d). struct date d. t=atoi(t_code). do { clrscr().

8). cout<<"Date:"<<d1<<"/"<<m1<<"/"<<y1.prepare_bill(t_billno). } } clrscr().clreol(). gotoxy(1. if(purchased) a.clreol().2).5). if(!item_found(tcode)) { gotoxy(5.t=atoi(t_code).8). cout<<"ENTER QUANTITY TO BE PURCHASED IN Kg".prepare_bill(t_billno). } gotoxy(60.24). gotoxy(5. return. cout<<"\7Item Code not found". gotoxy(1.clreol(). gotoxy(3.25). if(tcode==0) { if(purchased) a. do { valid=1. getch().25). 42 . display_record(tcode). return. gotoxy(1. tcode=t.

file.prepare_bill(t_billno). } }while(!valid). gets(t_quantity). } if(qty<1||qty>800) { valid=0.clreol().10).open("FOOd.. gotoxy(5. gotoxy(3. cout<<"Do You want to cancel this purchase(y/n):". cout<<"\7Range=1. ch=toupper(ch). getch(). fstream file.10).DAT". } while(ch!='N'&&ch!='Y'). if(ch=='N') { purchased=1. do { gotoxy(5.cout<<"Quantity:". ch=getche().24).800". return.ios::in). qty=atoi(t_quantity). if(t_quantity[0]=='0') { if(purchased) a. 43 .

add_bill(t_billno.seekg(0.t_cost. strcpy(t_itemname.12).itemname). ch=toupper(ch). a. gotoxy(5. } 44 . } do { gotoxy(5. } } file.sizeof(food))) { if(itemcode==tcode) { t_itemcode=itemcode.close(). while(file. i++. t_cost=itemcost. t_qty=qty.t_qty.t_itemname. clreol().ios::beg).t_price). t_price=itemprice.file.t_itemcode. } while(ch!='N'&&ch!='Y'). cout<<"Do you want to purchase more (y/n):". ch=getche().*)this.12).

a. getdate(&d). file. d1=d.prepare_bill(t_billno).open("BILL.DAT) int account::last_billno() { fstream file.float t_cost. file.*)this.da_mon. } //THIS FUNCTION RETURNS THE BILL NO. y1=d.ios::beg).DAT) void account::add_bill(int t_billno.seekg(0.float t_qty.DAT".da_day.ios::in). } //THIS FUNCTION ADDS THE RECORD IN THE BILL FILE ( t_itemcode.char t_itemname[30].sizeof(account))) t=billno. return t.da_year.close(). file.while(ch=='Y'). int d1. 45 . OF THE LAST RECORD IN //THE BILL FILE(BILL.m1. int t=0. dd=d1. while(file.y1.float t_price) { struct date d.

t_itemname).open("BILL. strcpy(name.write((char*)this. int d1.da_year. quantity=t_qty.DAT". ACCORDING TO PURCHASES MADE void account::prepare_bill(int t_billno) { clrscr(). y1=d.da_mon. file. billno=t_billno. file.close().y1. gotoxy(32.total_bill=0.da_day. struct date d. cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~". yy=y1. file. 46 .m1. cost=t_cost.3). getdate(&d). int total. code=t_itemcode.ios::out|ios::app).sizeof(account)). } //THIS FUNCTION PREPARES AND DISPLAYS THE BILL FOR THE //GIVEN BILL NO. price=t_price. cout<<"CUSTOMER BILL". fstream file. m1=d.4). gotoxy(33.

row).9).10). while(file. cout<<name. gotoxy(8.sizeof(account))) { if(billno==t_billno) { gotoxy(8.6).open("BILL. file.7). file. gotoxy(8. 47 . gotoxy(8.DAT". int row=11. cout<<price.gotoxy(55.row). cout<<code. gotoxy(18.seekg(0). cout<<"ITEMS PURCHASED". cout<<"BILL NO #"<<billno.ios::in). cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~`". fstream file. gotoxy(*)this. gotoxy(39. cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~".8). cout<<"Item code Item name Cost price Qty Total". gotoxy(47. gotoxy(10. gotoxy(8.5). cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~".5).row).row). cout<<"Date:"<<d1<<"/"<<m1<<"/"<<y1. cout<<cost.

fstream file.total_bill=0. cout<<"TOTAL BILL: Rs. file.seekg(0).ios::in).found=0.3). cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~".2). cout<<quantity."<<total_bill<<"/=".0. total=quantity*"BILL. cout<<"LIST OF BILLS". float total=0.flag=0. } //THIS FUNCTION DISPLAYS THE LIST OF THE BILLS void account::bill_list(void) { clrscr(). } } file. gotoxy(39.row+1). gotoxy(29.pageno=1.prev_billno=0. cout<<total.close(). total_bill=total_bill+total.DAT". gotoxy(63. gotoxy(30.0.row). 48 .row). row++. int row=5.gotoxy(56. getch(). file.

cout<<"TOTAL BILL:Rs"<<total_bill<<"/=".5).gotoxy(3. cout<<"Billno. gotoxy(52. } gotoxy(4. if(prev_billno!=billno) { if(flag) { total=quantity*price. gotoxy(3.row). cout<<code. } flag=1.sizeof(account))) { row++. row++. cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~`". gotoxy(24.Date Item code Item name Cost price qty Total".row).row).read((char*)this. cout<<dd<<"/"<<mm<<"/"<<yy. delay(20).row). 49 . gotoxy(11. found=1. while(file. cout<<billno.4). total_bill=total_bill+total.

file.row).row). gotoxy(71.row)..0.".10). } gotoxy(66. cout<<cost. cout<<"TOTAL BILL:Rs. row++. total_2=total_2+total_bill. gotoxy(52.gotoxy(32.1).:"<<pageno. getche(). if(!found) { gotoxy(5. gotoxy(61."<<total_2<<"/=". cout<<price.row). cout<<name. gotoxy(1.row). cout<<"Page no. cout<<"Press any key to continue. float total_2=0..close(). } void gra() { 50 . } row++.. cout<<"\7Records not found". prev_billno=billno. gotoxy(42.25).

outtextxy(320.150). setcolor(5). outtextxy(320.150).220.0.stangle-1+180. outtextxy(320.170. for(int"FASTFOOD AUTOMATION"). settextstyle(10.0.stangle. setcolor(8).0."d:\\tc\\bgi").300.150).300."SHASHWAT").stangle+199. ellipse(320."MADE BY").240. } closegraph().315.&gm. int gmode. } 51 . delay(250).""). delay(250).errorcode. settextstyle(10. setcolor(8). initgraph(&gd. settextstyle(4.300.150). ellipse(320.240. delay(250).240.300. outtextxy(320.240. setcolor(3).stangle+200.150). delay(9). setcolor(20). ellipse( gd=DETECT.240.300.0.4).1). ellipse(320.stangle+180.1).!kbhit().stangle++) { setcolor(7).265. ellipse(320. settextjustify(1.stangle+20.360.

main_menu(). menu m. m. gra(). } 52 .//THIS FUNCTION IS THE MAIN FUNCTION CALLING THE MAIN //MENU void main() { clrscr().

Purchase 53 .e.5. OUTPUT Output obtained by choosing the first option i.

After entering the item code of the item to be purchased Calculated bill is then displayed as shown below: 54 .

Output obtained by choosing the second option see menu Outputs obtained by choosing the third option edit menu 55 .

After choosing add item we get following: Output obtained by choosing modify item 56 .

Output obtained after entering the code 57 .

Modification of the details of the items in the menu. Large amount can be stored in a single hardisk and make it easy for the user to store data for future retrieval. Different tasks of keeping up of the track of the items in the menu. Service is generally for eating on premises. calculating the bill. It calculates bill quickly and correctly. y This project is time saving as it saves the time of the workers as well as customers. y Optimal utilization of resources can be done. Thus bills can be prepared more quickly and with more accuracy just by choosing the correct option which calculates the bill automatically. CONCLUSION As we all know that a restaurant is a retail establishment that serves prepared food to customers. placing of order and calculating bill can be carried out in different departments in a systematic way. So this project basically develops a software that can be used at such places to easily manoeuvre the daily tasks of taking the order. y Complicated calculations can be done more easily. deletion of items and keeping up of the track of the items purchased is much more convenient.Previously all the work was done manually and required a lot of time. Tedious book-keeping is completely eliminated with automation. The storage enhancement provide benefit in the form of cost saving. though the term has been used to describe take-out establishments and food delivery services.6. y It is also storage saving . addition of more items in the menu. 58 . modifying the details of the items in the menu etc. 59 .REFERENCES  Computer Science with C++ by Sumitra Arora  Object Oriented Programming in C++ by Robert Lafore  www.