Sie sind auf Seite 1von 35

COMPUTER SCIENCE

PROJECT
FOOD ORDERING SYSTEM

DONE BY :

AKASH A

CLASS 12

SUGUNA PIP SCHOOL


COMPUTER SCIENCE
PROJECT
FOOD ORDERING SYSTEM

AKASH.A
GRADE 12 - A2
SUGUNA PIP SCHOOL

1
SUGUNA PIP SCHOOL, COIMBATORE

CERTIFICATE

COMPUTER SCIENCE PROJECT

This is to certify that the Computer Science project report titled

...........FOOD ORDERING SYSTEM ........................................

which has been submitted to SUGUNA PIP School,meeting the

requirements of the CBSE Board practical examination for the

academic year 2019 – 2020, is a bonafide work done by

......................AKASH A..................................

Signature of Principal Teacher Incharge

Signature of Internal Examiner Signature of External Examiner

2
ACKNOWLEDGEMENT

I would like to thank my school Suguna PIPS for


giving me the opportunity to learn and nurture my
computer and coding skills. I would like to thank my
computer teacher Nithya ma’am for bringing about a
drastic change in my coding knowledge and helped me
complete a successful project. I would like to thank my
parents for their immense support and love.

I would also like to thank Ms.Sumita Arora for making


a textbook that got me interested in this wonderful world of
coding in the first place. I would like to thank all web
bloggers who make the internet a treasure trove of
information for all.

3
ABSTRACT

Welcome to Foodie’s Stop. This is the new age era where


technology surrounds us and all our activities are governed by
applications made by programmers. This is one such program
which acts as an ordering system for the food giant Foodie’s
Stop, a one stop place for pizzas, burgers and much more. The
program has been developed so as to enable customers to order
food and generate a bill which displays the total cost of the order
and cashier's name. Also, the program displays which rider has
been assigned at the end and the time taken to deliver the order.

The program also sports a specialised feature of login to make


the experience of each customer unique and gives the
application a personalized touch. Immerse into the world of
technology at the very place where technology and food now
coexists. Experience it yourself today at the one and only,
FOODIE’S STOP.

INTRODUCTION
4
This is a project made by using a perfect fusion of
polymorphism, inheritance and file handling concepts to create
an application which lets a user to login and order food for
which a bill is generated displaying the total amount for the
order and the cashier of the order after which a rider is assigned
to deliver the above said order to the user and the time it would
take for the delivery.

The project was developed using codeblocks and c++ standard


11. There are 431 lines of code built with three classes inherited
using a combination of multiple and multilevel inheritance
concepts.

WORKING PRINCIPLE

5
First a user login interface was created using basic character
match concept and then a list of delicacies on the menu is
displayed with a number tagged to each. Ordering is done by
entering the number tagged to the desired order when prompted
to and update the order if required or add any other order
similarly, if required. Else the page clears to display the bill for
the order using file concept where the total amount of the bill
and the cashier’s name is displayed.

Then the screen clears again to show the rider assigned to the
order, which is done using random number generation method ,
and thanks the user for using the app.

SOURCE CODE
#include<iostream>

#include<string.h>

6
#include<stdlib.h>

#include<conio.h>

#include<fstream>

#include<windows.h>

#include<time.h>

using namespace std;

void assign rider();

class one

public:

void menu1();

};

void one::menu1()

cout<<"\n\n\n\t\t\t\t\t\t ========== WELCOME TO FOODIE'S


STOP PIZZAZ =========="<<endl;

cout<<"\n\n\t\t\t\t\t\t\t =====START YOUR ORDER====="<<endl;

cout<<"\n\n\n\t===========================\t\t\t====================
======\t\t\t\t==========================="<<endl;

cout<<"\t[1] Veggie Supreme (Rs.480)\t\t\t[2] Exotica


Pizza(Rs.440)\t\t\t[3] Chicken Sizzler (Rs.580)\n\t[4] Chrispy Chicken
(Rs.520)\t\t\t[5] Spaghetti (Rs.350)\t\t\t\t\t[6] Country Feast
(Rs.400)\n\t[7] Tetrazzini (Rs.420)\t\t\t\t[8] Double Cheese
(Rs.540)\t\t\t\t[9] Makizushi (Rs.548)\n\t[10] Ham Burger
(Rs.390)\t\t\t[11] Margherita Pizza(Rs.525)\t\t\t\t[12] Fish 'n' Chips
(Rs.425)\n\t[13] Fajitas (Rs.335)\t\t\t\t[14] Tempura
(Rs.324)\t\t\t\t\t[15] Hot Dog
(Rs.360)\n\t===========================\t\t\t=============================
=\t\t\t\t===========================\n\n\n\t\t\t\t\t\t\t\t[16]
EXIT"<<endl;

7
cout<<"\n\t===============================================================
========================================================================"<
<endl;

class two:public one

protected:

int pizza,ch,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s=0;

string y,ye;

public:

void menu2()

{ ofstream write;

write.open("order.text");

if(!write)

cout<<"file can not open"<<endl;

exit (-1);

a:

b:

c:

cout<<"\n\n\tENTER YOUR ORDER (one order at a time): ";

cin>>ch;

cout<<"\n\n\tDO YOU WANT TO UPDATE YOUR ORDER (y/n) :";

8
cin>>ye;

if(ye=="y"|| ye=="Y")

goto b;

else

switch(ch)

case 1:

cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";

cin>>pizza;

a=480;

s=s+a*pizza;

write<<"YOU ORDER Veggie Supreme : 480";

write<<" \n";

write<<"NUMBER OF PIZZA IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Veggie Supreme "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 2:

cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";

cin>>pizza;

9
b=440;

s=s+b*pizza;

write<<"YOU ORDER Exotica : 440";

write<<" \n";

write<<"NUMBER OF PIZZA IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Exotica "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 3:

cout<<"\n\n\tHOW MANY CHICKEN SIZZLER YOU WANT :";

cin>>pizza;

c=580;

s=s+c*pizza;

write<<"YOU ORDER Chicken Sizzler : 580";

write<<" \n";

write<<"NUMBER OF Chicken Sizzler IS :


"<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Chicken Sizzler "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 4:

cout<<"\n\n\tHOW MANY CHRISPY CHICKEN YOU WANT :";

cin>>pizza;

10
d=520;

s=s+d*pizza;

write<<"YOU ORDER Chrispy Chicken : 520";

write<<" \n";

write<<"NUMBER OF Chrispy Chicken IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Chrispy Chicken "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 5:

cout<<"\n\n\tHOW MANY SPAGHETTI YOU WANT:";

cin>>pizza;

e=350;

s=s+e*pizza;

write<<"YOU ORDER Spaghetti : 350";

write<<" \n";

write<<"NUMBER OF Spaghetti IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Spaghetti "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 6:

cout<<"\n\n\tHOW MANY PIZZA YOU WANT:";

cin>>pizza;

11
f=400;

s=s+f*pizza;

write<<"YOU ORDER Country Feast : 400";

write<<"\n ";

write<<"NUMBER OF PIZZA IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Country Feast "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 7:

cout<<"\n\n\tHOW MANY TETRAZZINI YOU WANT:";

cin>>pizza;

g=420;

s=s+g*pizza;

write<<"YOU ORDER Tetrazzini : 420";

write<<"\n ";

write<<"NUMBER OF Tetrazzini IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Tetrazzini "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 8:

cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";

cin>>pizza;

12
h=540;

s=s+h*pizza;

write<<"YOU ORDER Double Cheese : 540";

write<<" \n";

write<<"NUMBER OF PIZZA IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Double Cheese "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 9:

cout<<"\n\n\tHOW MANY MAKIZUSHI YOU WANT :";

cin>>pizza;

i=548;

s=s+i*pizza;

write<<"YOU ORDER Makizushi : 548";

write<<" \n";

write<<"NUMBER OF Makizushi IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Makizushi "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 10:

cout<<"\n\n\tHOW MANY HAM BURGER YOU WANT :";

cin>>pizza;

13
j=390;

s=s+j*pizza;

write<<"YOU ORDER Ham Burger : 390";

write<<" \n";

write<<"NUMBER OF Ham Burger IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Ham Burger "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 11:

cout<<"\n\n\tHOW MANY PIZZA YOU WANT :";

cin>>pizza;

k=525;

s=s+k*pizza;

write<<"YOU ORDER Margherita : 525";

write<<" \n";

write<<"NUMBER OF PIZZA IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Margherita "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 12:

cout<<"\n\n\tHOW MANY FISH 'n' CHIPS YOU WANT :";

cin>>pizza;

14
l=425;

s=s+l*pizza;

write<<"YOU ORDER Fish 'n' Chips : 425";

write<<" \n";

write<<"NUMBER OF Fish 'n' Chips IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Fish 'n' Chips "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 13:

cout<<"\n\n\tHOW MANY FAJITAS YOU WANT :";

cin>>pizza;

m=335;

s=s+m*pizza;

write<<"YOU ORDER Fajitas : 335";

write<<" \n";

write<<"NUMBER OF Fajitas IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Fajitas "<<endl<<"\tYOUR ORDER SUCCESSFULLY


SAVED "<<endl;

break;

case 14:

cout<<"\n\n\tHOW MANY TEMPURA YOU WANT :";

cin>>pizza;

15
n=324;

s=s+n*pizza;

write<<"YOU ORDER Tempura : 324";

write<<" \n";

write<<"NUMBER OF Tempura IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Tempura "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 15:

cout<<"\n\n\tHOW MANY HOT DOG YOU WANT :";

cin>>pizza;

o=360;

s=s+o*pizza;

write<<"YOU ORDER Hot Dog : 360";

write<<"\n ";

write<<"NUMBER OF Hot Dog IS : "<<pizza;

write<<"\n";

cout<<"\n\n\n\tYOU ORDER Hot Dog "<<endl<<"\tYOUR ORDER


SUCCESSFULLY SAVED "<<endl;

break;

case 16:

cout<<"\n\t\t\t\t\t Brought To You By 247 Online


Systems.";

exit(0);

break;

16
default:

cout<<"\n\n\t\t\t\t\t\t\tYOU ENTER WRONG ORDER KEY !!!!!


"<<endl;

goto c;

break;

cout<<"\n\tDO YOU WANT ANOTHER ORDER (yes/no) :";

cin>>y;

if(y=="yes"|| y=="YES")

goto a;

else

cout<<"\n\t\t\t\t\t\t\tTHANK YOU FOR YOUR ORDER :) GENERATING BILL


";

for(int a=1;a<8;a++)

Sleep(500);

cout << "...";

cout<<"\n\t\t\t\t\t\t\t";

system("PAUSE");

system("cls");

cout <<
"\n\t\t\t\t\t\t\t ================================================"<<endl;

17
cout <<
"\t\t\t\t\t\t\t| Foodie's Stop |"<<endl;

cout <<
"\t\t\t\t\t\t\t ================================================"<<endl;

cout << endl;

cout << endl;

cout <<
"\t\t\t\t\t\t\t Bill No : CP51 Order : NB1353"<<endl;

cout << endl;

cout << endl;

cout <<
"\t\t\t\t\t\t\t Cashier : Harry"<<endl;

cout << endl;

cout<<"\t\t\t\t\t\t\t\t YOUR TOTAL BILL IS


Rs."<<s<<endl;

write<<"\t\t\t\t\t\t\t ";

write<<"\t\t\t\t\t\t\tTOTAL BILL IS : "<<s;

cout <<
"\n\t\t\t\t\t\t\t ================================================"<<endl;

system("PAUSE");

assignrider();

write.close();

void show1()

menu1();

menu2();

18
};

class three:public one,public two

public:

void assignrider();

void total()

long userId;

d:

cout<<"\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t--------------
-------";

cout<<"\n\t\t\t\t\t\t\tEnter Login Id = ";

cin>>userId;

cout<<"\t\t\t\t\t\t\t---------------------";

if(userId!=1353)

cout<<"\nDon't try to be
smart.....Enter correct id\n";

goto d;

else

cout<<"\n\n\n\t\t\t\t\t\t\tHello Customer3687,\n";

z:

string pwd="pass";

string pass="";

char c;

19
cout<<"\n\n\n\t\t\t\t\t\t\tPassword =
";

p:

c=getch();

cout<<"*";

if(c!=13)

pass=pass+c;

goto p;

if(pass==pwd)

cout<<"\n\n\t\t\t\t\t\t\tAccess
Granted. Welcome to our system\n\n\n";

system("PAUSE");

system("CLS");

show1();

else

cout<<"\nWrong Password\n";

goto z;

};

20
int main()

system("mode 650");

three ob;

ob.total();

getch();

void assignrider()

system("cls");

char statusrider1 = 'u',

statusrider2 = 'u',

statusrider3 = 'u',

statusrider4 = 'u',

statusrider5 = 'u',

statusrider6 = 'u',

statusrider7 = 'u',

statusrider8 = 'u';

x:

unsigned int seedval;

time_t t;

seedval = (unsigned)time(&t);

srand(seedval);

int s = (rand()%7);

switch (s)

case 0:statusrider1 = 'o';

21
cout << "Rider 1 has been assigned to you.\nPlease wait for 30
minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

case 1:statusrider2 = 'o';

cout << "Rider 2 has been assigned to you.\nPlease wait for 30


minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

case 2:statusrider3 = 'o';

cout << "Rider 3 has been assigned to you.\nPlease wait for 30


minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

case 3:statusrider4 = 'o';

cout << "Rider 4 has been assigned to you.\nPlease wait for 30


minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

case 4:statusrider5 = 'o';

cout << "Rider 5 has been assigned to you.\nPlease wait for 30


minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

case 5:statusrider6 = 'o';

cout << "Rider 6 has been assigned to you.\nPlease wait for 30


minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

case 6:statusrider7 = 'o';

cout << "Rider 7 has been assigned to you.\nPlease wait for 30


minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

22
case 7:statusrider8 = 'o';

cout << "Rider 8 has been assigned to you.\nPlease wait for 30


minutes and the food will be at your doorsteps.\nThank you for trying
Foodie's Stop.Come again later.";

break;

OUTPUT

23
24
25
26
27
28
29
30
31
CONCLUSION
This project explains the working and general principle of any
food ordering app .It is an improved version of this program that
is found in the modern day food ordering systems .The main
aspects used in this program are POLYMORPHISM,
INHERITANCE AND DATA FILE HANDLING.

The scope for further enhancement of this project would be to


add an option to cancel a made order within the time of delivery
and use time dynamics to make delivery more realistic with time
taken for order delivery embedded such as to render the rider
unoccupied after his assigned delivery is over.

BIBLIOGRAPHY

32
BOOK REFERENCES:

1. COMPUTER SCIENCE with C++ by Sumita Arora, 11th


edition.

WEB REFERENCES:

1. GEEKS for GEEKS < www.geeksforgeeks.org >


2. Tutorials point < www.tutorialspoint.com >
3. CPLUSPLUS <www.cplusplus.com >

33
THANK
YOU.

34

Das könnte Ihnen auch gefallen