csc.project class 12
csc.project class 12
ROLL NO :
NAME : S. ANBUSELVAN
01 ACKNOWLEDGEMENT 01
02 INTRODUCTION TO PYTHON 02
06 SOURCE CODES 06
07 OUTPUTS 17
08 BIBLIOGRAPHY 19
ACKNOWLEDGEMENT
Apart from my efforts, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express
my gratitude to the people who have been instrumental in the successful
completion of this project.
The guidance and support received from all the members who contributed
and who are contributing to this project, was vital for the success of the project.
I am grateful for their constant support and help.
INTRODUCTION TO PYTHON
Python is a dynamic, interpreted ( byte code-compiled) language.
There are no type declarations of variable, parameters, functions or
methods in the source code. This makes the code short and flexible
and you lose the compile time type checking of the source code.
Python tracks the types of all values at runtime and flags code that
does not make sense as it runs.
Python was designed for readability and has some similarities to
the English Language with influence from mathematics.
Python uses new line to complete a command as opposed to
other programming languages which often use semicolons or
parentheses.
Python relies on indentation using whitespace to define scope;
such as the scope of loops, functions, and classes. Other
programming languages often use curly brackets for this
purpose.
Advantages of Python
1. Easy to Read, Learn and Write.
2. Improved Productivity
3. Interpreted Language.
4. Free and Open – Source.
5. Vast Libraries Support.
6. Portability
Disadvantages of Python
1. Slow Speed
2. Not Memory Efficient
3. Weak in Mobile Computing.
4. Run Time errors.
AIR TICKET RESERVATION
OBJECTIVES OF PROJECT
SOFTWARE REQUIREMENTS:
• Windows OS
• Python
DATABASE , TABLE & FUNCTIONS USED
DBMS: MySQL
Host: local host
User: root
Pass: root
Database: hotel
Table Structure: (Images Bellow)
SOURCE CODES
importos
import platform
importmysql.connector
import pandas as pd
importdatetime
host='localhost',
database='air')
mycursor=mydb.cursor()
defregistercust():
L=[]
name=input("enter name:")
L.append(name)
addr=input("enter address:")
L.append(addr)
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()
defclasstypeview():
print("Do you want to see class type available : Enter 1 for yes :")
ifch==1:
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
defticketprice():
n=int(input("No of passenger:"))
if(x==1):
s=6000*n
elif (x==2):
s=4000*n
elif (x==3):
s=2000*n
else:
defmenuview():
print("Do yoy want to see menu available : Enter 1 for yes :")
ifch==1:
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
deforderitem():
global s
print("Do yoy want to see menu available : Enter 1 for yes :")
ifch==1:
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
if(d==1):
a=int(input("enter quantity"))
s=10*a
print("your amount for tea is :",s,"\n")
elif (d==2):
a=int(input("enter quantity"))
s=10*a
elif(d==3):
a=int(input("enter quantity"))
s=20*a
elif(d==4):
a=int(input("enter quantity"))
s=10*a
elif(d==5):
a=int(input("enter quantity"))
s=50*a
a=int(input("enter quantity"))
s=30*a
elif(d==7):
a=int(input("enter quantity"))
s=10*a
elif(d==8):
a=int(input("enter quantity"))
s=20*a
elif(d==9):
a=int(input("enter quantity"))
s=50*a
elif(d==10):
print("you have ordered pasta")
a=int(input("enter quantity"))
s=50*a
else:
deflugagebill():
global z
print("Do yoy want to see rate for lugage : Enter 1 for yes :")
ifch==1:
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
z=y*1000
print("your laundarybill:",z,"\n")
return z
def lb():
print(z)
def res():
print(s)
defticketamount():
print("lugage bill:")
print(lb)
print("food bill:")
print(“total amount”)
defMenuset():
exceptValueError:
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:
Menuset()
defrunagain():
while(runagn.lower()=='y'):
if(platform.system()=="windows"):
print(os.system('cls'))
else:
print(os.system('clear'))
Menuset()
runagain()
OUTPUTS
BIBLIOGRAPHY
***