Project_Food Ordering System
Project_Food Ordering System
E9TD 1886
A PROJECT REPORT ON
FOOD ORDERING SYSTEM
SUBMITTED BY-
SUBMITTED TO-
NAME- Daksh ghai
MS. SEFMA BHATIA
CLASS- XII-A
PGT(CO MP SCI)
ROLLNO- G
SUBJECT COMPUTER
SCIENCE f083}
that
xll (P lyl) of otsAV hzssghas done
hb on Oon OnoE ONO sygz¥M under my
superdslon.
He has taken interest and has shown at most
dncerity
In completion cfthis prcjecc
I thb Project up to my e•oeaation & as per
guidelines issuad by CBSE, NEW DEt 'II.
ACKNOWLEDG ENT
It is with pleasure Ihat l acknowledge my sincere gratitude
to our teacher, MS. SEEMA BHATIA who taught and undertook
the responsibility of teaching the subject computer science. I
have been greatly benefited from his/her classes.
My sincere thanks goes to our Principal MS. REENA RAJPAL
who has always been a source of encouragement and
support and without whose inspiration, this project would
not have been a successful.
Finally, I would like to express my sincere appreciation for
all the other students for my batch their friendship & the
fine times that we all shared together.
Last but not least, I would like to thank all those who had
helped directly or indirectly towards the completion of this
project.
DAKSH GHAI
XII- PCM
INTRODUCTION
This programme first asks the user that this is a first time he using the programme
on his/her system. If the entered option is correct the programme automatically run
the commands which is necessary to run this programme perfectly. This programme
helps the user to order food from various restaurant. After entering details, this
programme automatically shows the names of Restaurant. The user can choose the
restaurant name to view its Menu card and order food that he likes. This programme
also allows the user to enter the feedback. This programme admin controls has
various kinds of options like create a new menu card, update a menu card, delete a
menu card, see customer details and see the feedback of the customer. However,
this admin function can only be accessible only if the entered admin-id and
password is correct.
[6]
THEORETICAL BACKGROUND
What is Python?
developed by Guido Van Rossum in 1991 at the National Research Institute for
Mathematics, Netherlands.
Features of Python:
• It supports GUI.
[10]
What is File Handling ?
A file in itself is a bunch of bytes stored on some storage devices like hard-disk,
thumb-drive etc. The data files can be stored in two ways: i. Text files ii. Binary files
A text file stores information in ASCII or Unicode characters, where each line of text
is terminated, (delimited) with a special character known as EOL (End of Line)
character. In text files some internal translations take place when this EOL character
is read or written. A binary file is just a file that contains information in the same
format in which the information is held in memory, i.e., the file content that is
returned to you is raw (with no translation or no specific encoding). The open()
pI
function is used to open a data file in a program through a file-object (or a file-
handle). A file-mode governs the type of operations (e.g., read/ write/ append)
possible in the opened file i.e., it refers to how the file will be used once it’s opened.
A text file can be opened in these file modes: 'r', ’w’, 'a’, 'r+', ’w+', ’a+' A binary file
can be opened in these file modes: 'rb', 'wb', 'ab', 'r+b’('rb+’), ’w+b'(’wb+’);
a+b’(’ab+’). The three file reading functions of Python are: read(), readline(),
readlines() While read() reads some bytes from the file and returns it as a string,
readline() reads a line at a time and readlines() reads all the lines from the file and
returns it in the form of a list. The two writing functions for Python data files are
write() and writelines(). While write() writes a string in file, writelines() writes a list In
a file. The input and output devices are implemented as files, also called standard
streams. There are three standard streams: stdin (standard input), stdout (standard
output) and stderr (standard error) The absolute paths are from the topmost level of
the directory structure. The relative paths are relative to current working directory
denoted as a dot(.) while its parent directory is denoted with two dotst..). The full
name of a file or a directory is called pathname. Steps to Process a file: there are
five steps to use files in the python program.
Determine the type of file usage Under this step, you need to determine
whether you need to open the file for reading purpose (input type of usage)
or writing purpose (output type of usage).
Open the file and assign its reference to a flle-object or file-handle Next, you
need to open the file using open() and assign it to a file-handle on which all
the file-operations will be performed. Just remember to open the file in the
file-mode that you decided in step 1.
iii. Now process as required as per the situation, you need to write instructions
to process the file as desired. For example, you might need to open the file
[12j
and then read it one line at a time while maKing some computation, and so
on.
iv. Close the file This is very important step especially if you have opened the
file in write mode. This is because, sometimes the last lap of data remains in
buffer and is not pushed on to disk until a close() operation is performed.
(i) Regular Text Files: These are the text files which stores the text in the
same form as typed. Here the newline character ends a line and the text
translation takes place. These files have a file extension as .txt.
(ii) Delimited Text Files: In these text files, a specific character is stores to
separate the values, i.e., after each value, e.g., a tab or a comma after
every value.
• When a tab character is used to separate the values stored, these are
called TSV files (Tab Separated Values files). These files can take the
extension as .txt or .csv.
• When a comma is used to separate the values stored, these are called
CSV files (Comma Separated Values files). These files take the
extension as .csv.
[13]
SOURC E CO D E
reset (Module)
[21]
a.write(“\n”)
a.cIose0
res 2 (module)
a.write("\n")
a,cIose()
res 3(moduIe)
if len(i) = '1:
forj in i:
[23}
a.writes)
a.write("\n”)
else:
for k in i:
for m in k:
a.write(m)
a.write(’V")
a.close()
res 4(module)
res read(module)
def read(res):
a=open(res+".txt”,"r")
z=a.readlines()
for i in z:
s=i.spIit0
if len(s)-=1:
125)
forj in s:
print("\n")
print("
print(" "*(30-int(round(lens))/2)),j}
print("” **”***’**””*2)
print("\n ’)
else:
b=len(s[0])
print(s[0]," ”*(60-b),s[\])
print("\n")
a.close()
create_res(module)
res_search(module)
def search(x,y):
f=open(x+".M",' r")
h—f.readlines()
d=1234
for i in h:
m--i. split0
if len(m)»1:
if m[0]==y:
[27j
d=12345
return [m[0],int(m[J])]
if d==1234:
s=[y+” not found’,0]
return s
f.close()
{28)
MAIN CO DE
impor|os
import res 1
import reset
import res 3
import res 4
import create res
import res read
import res search
print("\n")
print("NOTE 1: please enter the information as instructed .")
print("Note 2: please write underscore(' ’) instead of spaces.") print("\
n")
check=str(input{"Are you running this program for the first time in your system (y/n)
[29]
cus.writeIines([” Ankit "," 24 "," male "," 9742472940 "," c-
90,ADARSH R0AD,NEAR METRO STATIO N,DELHI-110032 ",”\n"])
cus.close()
f201 -open("res names.txt","w")
if check in ("n","N™,"No',"no',"NO","y™,”Y™,"Yes”,"YES”,"yes"):
food —True
while food==True:
print("\n")
print('in")
print(””*”*S8)
print("\n")
print(" "*50+"Food Ordering System™)
print("\n")
print("”“"*58)
print("””"*58)
print('in")
print(”1. login as Admin ")
print("2. login as customer ")
{30]
print("3. exit")
print(in")
x=int(input("enter your choice (1,2,3):"))
print(in“)
print("You choose option ",x)
pat=0
food1=True
while food1 -True:
print("\n")
print(”\n")
print("”**”Enter Your Details**”*”)
print(’in")
admin=str(input("Enter Admin ID : ”))
password=str(input("Enter Password : "))
adm=open("Admin.txt","r")
z=adm.readlines
-B
for i in z:
q—i.spIit0
s+=[q]
pa=FaIse
for i in s:
if i[0]——admin and i[1]==password:
print(’in")
print(“.......Login Successfull..........")
print('V")
pa=True
ad=True
{31j
while ad——True:
print("\n’)
print(" LO G IN AS A ADMIN’”*””***”’”*”””")
print("1 : Create a New Menu ")
print("2 : Update a Menu Card")
print("3 : Delete a Menu Card")
print("4 : See Customer information")
print("5 : See Customer Feedback")
print("6 : Back To Main Menu")
print("7 : Exit ")
print("\n')
a=int(input("Errter the choice (1,2,3,4,5,6,7) :"))
print("\n')
if a==1:
name-str(input("Enter the name of restaurant : ”))
f65=open("res names.txt","a")
f65.write(name)
f65.write('\ri")
’f65.close()
create esres(name}
print("..........seccessfuIly created a new one............")
elif a- 2:
f20=open("res_names.txt","r™}
print(' Select From The Given List
") print(’M"}
tt=0
132)
stp=f20.readlines 0
for i in stp:
print(i)
n+=1
print("ïn")
seìect=str(input("Enter the name of restaurant : "))
select1 41 =select+"\n"
if seIect14J in stp:
res read.read(select)
f80=open{select+".txt”,”r”)
sty= f80.readlines0
print("\n ')
foo1 =str(input("enter the name of the food lhat you want to
updale : "))
a=False
for e in sty:
s99=e.splits
if s99(0]==foo1:
a-True
if a==F-alse:
print("............food item not found.............”)
f20.close0
f80.cIose0
else:
f15=open("new file.txt",”w")
foo2=str(input("enter new name : "))
pr4=str(input("enter new price : "))
for i in sty:
133]
s34=i.split()
if s34[0]!-foo1 :
f1 5.write(i)
if s34[0]==foo1 :
f1 5.writeIines([foo2*“ ",pr4+"\n"|)
print("..........MENU CARD UPDATED.............."}
f15.close0
f20.closed
f80.cIose0
os.remove(select+".txt")
os.rename("new file.txt",seIect+".txt")
else.
print(".......... restaurant cannot be found............")
exif a==3:
f45-open(”res names.1xt","r")
print(" Select Frorri The Given List
") print("\n")
cp-0
st= f45.readlines0
for i in st:
if cp 0.
print(i)
cp+=1
print("\n")
delete=str(input("Enter the name of restaurant : "))
delete1 =delete+'C"
if delete1 in st:
{34]
os.remove(delete+”.txt”)
f10=open("new file.txt”,"w™)
for i in st:
if i!=deIete:
f10.write(i)
f10.closed
f45.cIose0
os.remove("res names.txt")
os.rename("new file.txt",”res names.txt™)
print(".............menu card successfully seleted............")
else:
print(’..........File cannot be found.............")
elif a==4:
cust=open("Customer.txt”,”r")
r 3= cust.readlines0
for i in r3:
s3=i.spl
print(s3[0]," "*(30-Ien(s3[0])),s3[J]," "*(15-Ien(s3[1 ])),s3[2],"
"*(20-Ien(s3[2])),s3[3]," "*(20-len{s3[3])),s3[4]," "*(40-Ien(s3[4])))
elif a==5:
f202=open(”customer_feedback.txt","r")
rep=f202.readlines 0
for i in rep:
s40=i.split()
print(s40[0],“ "*(30-len(s40[0|)),s40[1])
[35]
elif a==6:
print(”You choose option ',a)
print("\n")
food1 =False
ad=False
exif a==7:
print("You choose option ",a)
print("\n")
print(”*"*49+"Thanks for coming"+"*"*49)
food=False
food1 =FaIse
ad= False
else:
print("Your input is wrong please enter a valid input")
print(’M”)
if pa==FaIse:
pat+-1
if pat=—3:
print(”.................NO TRIAL LEFT FO R Y0U. SO, THE PROG RAM
HAS BEEN TERMINATED.....................")
print("\n")
print("")
print('\n")
food-False
food1=FaIse
else:
print("............Please Enter a Valid ID And Password.....",(3-pat),"tries
left.. .“)
elif x==2:
food2=True
white food2= -True:
print(3n”)
print(”*************”’L0 GIN AS CUSTOMER”*”**"*”*”*””*")
print("\n")
print("””””Enter Your Details““““”)
print("\n”)
name=str(input("En1er Your Name "))
print("\n")
print("1 Want To Buy Meal”)
print(”2 : Want To Enter Feedback")
print("3 : Back To Main Menu’)
print("4 : EXit"}
print("\n“)
at=int(input("Enter the choice (1,2,3,4) :"))
print(”\n")
if at=—J !
age=str(input("Enter Your Age "))
gender=str(input("Enter Your Gender : "))
phone=str(input("Enter Your Mobile No. "))
address-str(input("Enter your Address : "))
cus=open("Customer.txt”,”a")
cus.writelines((’ ",name," ",age," ",gender," ",phone," ",address,"\n"])
cus.close0
f20=open(”res names.txt","r")
(37)
print(“\n")
print("””**”””*”**”*Select From The Given List“”***””*”*”*”*")
print("\n")
tt=0
stp=f20.readlines 0
for i in stp:
if tt»0:
print(i)
It+=1
print("\n")
seIect=str(input("Enter the name of restaurant :
")) data-§
seIect1=select+’in"
if seIect1 in stp:
res„read.read(select)
we=True
while we—=True:
see=str(input("Enter the product name : " ))
data+=(res search.search(sele4,se.e)]
wr=str(input("want to Enter more(y/n): "))
if wr in ("n","N","No","no","NO"):
we-False
if wr not in ("n’,’N","NO",' no”,"N 0 ","y","Y”," Yes“,"YES“,"yes"):
print(“...........NO VALID INPUT SO THE PROG RAM IS
ASSUMED NO...........")
we=FaIse
sum=0
print("\n")
38j
print("
print(" "*(24-int(round(Ien(select))/2)),seIect)
print("
print(" "*20, 'BILL™)
for i in data:
sum+= i[1]
print(i[0]," "“(40-Ien(i[0])),i[1])
print(" "“““*“”‘”*“’“”“”‘*")
print("TOTAL“," "“29,"(RS.)",sum}
print(" "”‘*“”””“””“*““””““*”‘”‘”*”“”“***”*W")
print("\n")
print(" l hanks for coming””*””””””’”*”*“””")
food2= False
food— False
else.
print(".........Please Enter The Valid Input..........")
if at==2:
f202=open("customer„feedback.txt","a”)
feed=str(input("Enter your feedback : "))
f202.writeIines([name+" ",feed+"\n"])
f202.close()
if at==3:
food2= False
if at-=4:
[3 1
print(' You choose option ",at)
print('\n")
print{"*"*49+"Thanks for coming"+"*"*49}
food= False
food2= False
if at»4:
print(’ Your input is wrong please enter a valid input")
elif x==3:
print(’V™)
print("*"*49+” Thanks for coming "+"*"*49)
food=False
else:
prinl('in™)
print("Your input is wrong please enter a valid input”)
print('V™)
[40]
OUTPUT
ABMIN CONTROLS:
[41)
IF THE ADMIN ID AND PASSWORD IS CORRECT.
THEN,
1. Creating a new menu.
OUTPUT:
Rnker the fczcl item use mnderscz*e instaat ofi npccm•m § : quLab aWuR
Kn€er tAe pxlce ol tbe item €ypm ; IOD
Enter tke Cccd item ( use oodexscose Road ei spa•zos } : hey am ka kolwa
(42]
2. Update a menu card.
OUTPUT:
enter t he cho1ce (1, 2, 3, I, 5, e, ') :2
aya_:restaurant
1'. L^
27C
IOL
•
[43]
3. Delete a menu card
OUTPUT:
OUTPUT:
21
[44]
5. See customer feedback
OUTPUT:
EDB*CT
:L_.r_a_‹t:y’_v:,z:_.hizIg_l.ma:._cn_:u._.:7:•«.n-_u..*z_:cz_IcrL«zz*nl..
these $v jetg a $Ns_b'Jt_nt.i I l_lociirj_.sme_t!n- s_ ul5_E•_hetter_i f_ -hete_a-e_ * *-e_ restaurs *t s.
Ryan
, .-'„.. -
it's itbe:io._.tt_i-sn_#o*:ây_foz_a raizc.
|45]
CUSTOMER CONTRO LS:
. Buy meal
OUTPUT:
{461
Rnter the r.aae cf restaurant : KAOI.LW9N FIST FOOD PAHADI9E
chease burrez
Kam_i +r]mr
?ando:ri chicken burger
ch:ckcn_burg:::r
emu_and_ohic!cen_b rgcr
spicv_crillzd_ohickvn burger
Pmirsh_special_bu:ger
Chi:ker_wxap
Dand'acri_chicken_vrap
14L+
l*L'
{47)
2 Gú
215
Mcxicnn_grccn_mav: 'TOO
Mineral water
[48a
2. Enter feedback
OUTPUT:
(49]
SCREENSHOTS OF TEXT FILES
TEXT FILE 1
BURGE RS
Tikki bunged ys
Egg burger 55
c heese drirger t50
Tikki ur‘ap 6s
Crunc fjy_ur•ap 9a
sezh'nan_wap see
Chee fi e wr ap 7s
Corn_arap oo
chicken wrap 98
fandoor i_chicken_ur ap tye
Sri11 ed chicken wrap z4e
kadiansh c hicken snap t7e
PIzzAs
argheritz 199
Cheese 8_corn 26d
"am house 2zs
#xisan green wave 400
*eppy paneer 39•T
*aneer makhani 350
-h i ck en p? z za 558
7RZt'IKS
Mineral water 20
.ot a 4e
.enon_soda 30
cngo shake ye
[SO]
TEXT FILE 2
Łtilk 20
HorL i cks ze
Bournv ita
3e
eadan_ø i I k ee
spec:tab kadiarsh milk S5
{51]
TEXT FILE 3
' sueet_corn_soup @
\icken_swt_corn_*oup yes
\Tcken clear soup TO
aTcken hot N sour soup t2e
hicken_wt_nood}es t2e
eg states
rTspy chiily babycorn 't4S
rispy uushrooa_gaper_saLt tye
'elfreed ball ABB
rTed_panner *5s
ice and noodles
fe@Tried_rice I.28
6 xed_f rd ed_rI ce 198
£ I-ried rice tze
Chicken_trted_rLce \5e
veg choaziein GB
NTxed_ch in 16B
£gg_c ein 08
chicken ch *metn was
Prawn chain y4g
chinese
ye baby corn S55
Chy}T i_aushno ¥ ABB
Childi paneer t56
veg nanchurTan Us
sarlTc chicken y7a
Hot_garT?c ch:tcken :t75
TEXT FILE 4
jI\ITED PUSSY
tyson y23'4?G3898
lszl
TEXT FILE 5
:ndźan veg
ix veg 136
/at_nakhnż 9e
ul butter fry 75
•aneer butter_ziasat a 75
nadal paneer 158
"łjana_•asa}a $65
tashatrż_a1udan MS
yabaratana korria t75
sahi_paneer 1ae
tnąian rice
steaa_rżce że
3eera_rice 8s
veg_puIao ż35
¥ashnżrż_pu1ao 185'
Paneer_puLao 16
Chżnese veg
Paneen tżkka(6pcs) 168
ds 6S
Hgriey chżLly tato tź0
yand0or ż_rot ź $5
eutter tand@ry roti DO
Butter naan m
asala kmcha ss
tto0 veg
Chic ken kasa t50
TEXT FILE 7
TEXT FILE 8
[54]
HARDWARE AND SOFTWARE REQUIREMENTS
. Pyhon I DLE.
. Modern Operating System:
. Windows 7 or 10
. Mac OS X 10.11 or higher, 64-bit
. Linux: RHEL 6/7, 64-bit (aImos1 all libraries also
work in Ubuntu)
. x86 64-bit CPU (Intel / AMD architecture)
. 4 G B RAM
. 5 G B free disk space
[55]
BIBLIOGRAPHY
1. Made by DAKSH OHAI, SHREYAAN OUPTA, MUDfT RAJP of
CLASS 12-A as a project for COMPUTER KIENCE of SESSION
2023-24.
2. Taking the help of internet for searching menu cards.
3. Use PYTHON-IDLE for developing the food ordering system.
4. Use various In-built function:
• Creating modules and Importing them to main file.
• While loop and for
• Conditional statements (if, elif, else).
• Logical operators, arithmetlc operators and so on.
• Use of data types like Integer, strlngs, Ilst, tuples, etc.
• Use of basic text file handling