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

TABLE OF CONTENTS

Acknowledgement

Certificate

Packages and their purpose

Coding

Output Screen Shots

Requirements

Bibliography
Acknowledgement

I thank my Computer Science teacher Mrs.K.Hazra


for guidance and support. I also thank my
Principal Mr. A.T.Mishra .I would also like to thank
my parents and my friends for encouraging me
during the course of this project. Finally, I would
like to thank CBSE for giving me this opportunity
to undertake this project.
Certificate
This is to certify that Sabyasachi Mishra of class
XII-B, Kendriya Vidyalaya No-1(1st Shift),
Bhubaneswar has successfully completed his project
in computer practical for the AISSCE as prescribed
by CBSE in the year 2019-2020.

Date :

Registration No. :

Signature of Internal Signature of External


Examiner Examiner

__________________ __________________

Signature of Principal

_______________________________________________
PACKAGES AND MODULES
USED AND THEIR PURPOSE

 OsModule :-The OS module in python provides functions for interacting


with the operating system. OS, comes under Python's standard utility
modules. This module provides a portable way of using operating system
dependent functionality. The *os* and *os.path* modules include many
functions to interact with the file system.

 platform:-The platform module in Python is used to access the


underlying platform's data, such as, hardware, operating system, and
interpreter version information. The platform module includes tools to see
the platform's hardware, operating system, and interpreter version
information where the program is running.
 mysql.connector:-This package contains the mysql.connector
module, which is written entirely in Python. PyMySQL:
This package contains the pymysql module, which is written entirely
in Python. It is designed to be a drop-in replacement for the MySQL-python
package.
 Datetime :-The datetime module supplies classes for manipulating dates
and times in both simple and complex ways. ... For applications requiring
aware objects, datetime and time objects have an optional time zone
information attribute, tzinfo , that can be set to an instance of a subclass of the
abstract tzinfo class.
CODING
PYTHON CODING

import os
import platform
import mysql.connector
import datetime
global z
mydb = mysql.connector.connect(user='root', password='password',host='localhost',
database='hotel')

mycursor=mydb.cursor()

def registercust():
L=[]
name=input("enter name:")
L.append(name)
addr=input("enter address:")
L.append(addr)
jr_date=input("enter date of journey:")
L.append(jr_date)
source=input("enter source:")
L.append(source)
destination=input("enter destination:")
L.append(destination)
cust=(L)
sql="insert into pdata(custname,addr,jrdate,source,destination)values(%s,%s,%s,%s,%s)"
mycursor.execute(sql,cust)
mydb.commit()
def classtypeview():
print("Do yoy want to see classs type available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from classtype"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def ticketprice():
print ("We have the following rooms for you:-")
print ("1. type First class---->rs 6000 PN\-")
print ("2. type Business class---->rs 4000 PN\-")
print ("3. type Economy class---->rs 2000 PN\-")
x=int(input("Enter Your Choice Please->"))
n=int(input("No of passenger:"))
if(x==1):
print ("you have opted First class")
s=6000*n
elif (x==2):
print ("you have opted Business class")
s=4000*n
elif (x==3):
print ("you have opted Economy class")
s=2000*n
else:
print ("please choose a class type")
print ("your room rent is =",s,"\n")
def menuview():
print("Do yoy want to see menu available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from food"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)

def orderitem():
global s
print("Do yoy want to see menu available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from food"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)

print("do you want to purchase from above list:enter your choice:")


d=int(input("enter your choice:"))
if(d==1):
print("you have ordered tea")
a=int(input("enter quantity"))
s=10*a
print("your amount for tea is :",s,"\n")
elif (d==2):
print("you have ordered coffee")
a=int(input("enter quantity"))
s=10*a
print("your amount for coffee is :",s,"\n")
elif(d==3):
print("you have ordered colddrink")
a=int(input("enter quantity"))
s=20*a
print("your amount for colddrink is :",s,"\n")
elif(d==4):
print("you have ordered samosa")
a=int(input("enter quantity"))
s=10*a
print("your amount fopr samosa is :",s,"\n")
elif(d==5):
print("you have ordered sandwich")
a=int(input("enter quantity"))
s=50*a
print("your amount fopr sandwich is :",s,"\n")
elif(d==6):
print("you have ordered dhokla")
a=int(input("enter quantity"))
s=30*a
print("your amount for dhokla is :",s,"\n")
elif(d==7):
print("you have ordered kachori")
a=int(input("enter quantity"))
s=10*a
print("your amount for kachori is :",s,"\n")
elif(d==8):
print("you have ordered milk")
a=int(input("enter quantity"))
s=20*a
print("your amount for kachori is :",s,"\n")
elif(d==9):
print("you have ordered noodles")
a=int(input("enter quantity"))
s=50*a
print("your amount for noodles is :",s,"\n")
elif(d==10):
print("you have ordered pasta")
a=int(input("enter quantity"))
s=50*a
print("your amount for pasta is :",s,"\n")
else:
Print("please enter your choice from the menu")
def lugagebill():
global z
print("Do yoy want to see rate for lugage : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from lugage"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
y=int(input("Enter Your weight of extra lugage->"))
z=y*1000
print("your laundarybill:",z,"\n")
return z
def lb():
print(z)
def res():
print(s)
def ticketamount():
a=input("enter customer name:")
print("customer name :",a,"\n")
print("lugage bill:")
print(lb)
print("food bill:")
print(res)

def Menuset():
print("enter 1: To enter customer data")
print("enter 2 : To view class")
print("enter 3 : for ticketamount")
print("enter 4 : for viewing food menu")
print("enter 5 : for food bill")
print("enter 6 :for lugage bill")
print("enter 7 : for complete amount")
print("enter 8 : for exit:")
'''try:
#userinput=int(input("pleaseselect an above option:"))
except ValueError:
exit("\n hi thats not a number")'''

userinput=int(input("enter your choice"))


if(userinput==1):
registercust()
elif(userinput==2):
classtypeview()
elif(userinput==3):
ticketprice()
elif(userinput==4):
menuview()
elif(userinput==5):
orderitem()
elif(userinput==6):
lugagebill()
elif(userinput==7):
ticketamount()
elif(userinput==8):
quit()
else:
print("enter correct choice")
Menuset()
def runagain():
runagn=input("\n want to run again y/n:")
while(runagn.lower()=='y'):
if(platform.system()=="windows"):
print(os.system('cls'))
else:
print(os.system('clear'))
Menuset()
runagn=input("\n want to run again y/n:")
runagain()
MYSQL CODING

Database:- hotel

create database hotel;


use hotel;

Table:-pdata
create table pdata(custname varchar(20),addr varchar (30),jrdate varchar(10),source
varchar(10),destination varchar(10));

Table:-classtype
create table classtype (snovarchar(5),classtype varchar(10),price integer(10));
 insert into classtype values ('1','Firstclass',6000);
 insert into classtype values ('2','Busiclass',4000);
 insert into classtype values ('3','Ecoclass',2000);

Table:- food
create table food(sno integer(10),itemname varchar(10),rate integer(10));
 insert into food values(1,"tea",10);
 insert into food values(2,"coffee",10);
 insert into food values(3,"colddrink",20);
 insert int0 food values(4,"samosa",10);
 insert into food values(5,"sandwich",50);
 insert into food values(6,"Dhokla",30);
 insert into food values(7,"kachori",10);
 insert into food values(8,"milk",20);
 insert into food values(9,"noodles",50);
 insert into food values(10,"pasta",50);

Table:- luggage
create table lugage(sno integer(10),weight varchar(10),rate integer(10));
 insert into lugage values(1,"20kg",1000);
 insert into lugage values(2,"25kg",1500);
 insert into lugage values(3,"30kg",2000);
 insert into lugage values(4,"50kg",3000);
SCREEN SHOTS OF OUTPUT
MENU

CHOICE1

CHOICE 2

CHOICE 3
CHOICE 4

CHOICE 5

CHOICE 6
REQUIREMENTS
HARDWARE REQUIRED

 Processor :Intel Core i7


 Ram : 4 GB
 HardDisk: 20 Gb(min).
 Printer, to print the required documents of the project

SOFTWARE REQUIRED

 Operating system :Windows10


 Jupyter Notebook (Python 3.7), for execution of python
program and MySQL 5.7 for database management
 Ms word 2010, for documentation.
BIBLIOGRAPHY

 Computer Science with Python Class XII BY :–SUMITA ARORA

 www.google.com
 www.sourceforge.com
 www.github.com

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