100% found this document useful (6 votes)
20K views27 pages

Class 12 CS Project

This document is a project report for a computer science connectivity based project on a tours and travels agency. It includes an index, certificate, acknowledgement, introductions to Python and MySQL, hardware and software specifications, database and table structure, Python coding, and bibliography sections. The Python coding section allows a user to register for a trip by entering details like name, contact number, locations, duration, payment method, and selects the mode of transportation. It stores the data in a MySQL database table.

Uploaded by

Ks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (6 votes)
20K views27 pages

Class 12 CS Project

This document is a project report for a computer science connectivity based project on a tours and travels agency. It includes an index, certificate, acknowledgement, introductions to Python and MySQL, hardware and software specifications, database and table structure, Python coding, and bibliography sections. The Python coding section allows a user to register for a trip by entering details like name, contact number, locations, duration, payment method, and selects the mode of transportation. It stores the data in a MySQL database table.

Uploaded by

Ks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

COMPUTER

SCIENCE

CONNECTIVITY
BASED PROJECT
TOPIC-TOURS AND
TRAVELS AGENCY

Name-Srishti Gupta
Class- XII-A
Group member names-
Sumegha Gupta
Isha Shankh
INDEX
S.NO. TOPIC
1. Certificate
2. Acknowledgement
3. Introduction to Python
4. Introduction to Mysql
5. Hardware and Software Specifications for the
project
6. Database and table structure
7. Python Coding
8. Input and Output (Python)
9. Bibliography

MAHARAJA AGARSAIN PUBLIC SCHOOL


ASHOK VIHAR, DELHI

CERTIFICATE

This is to certify that tours and travels

computer science project is developed by

Srishti Gupta of 12-A

under my supervision and guidance.

The work done by is original.

NITIN GUPTA

PGT, COMPUTER SCIENCE

DATE-
ACKNOWLEDGEMENT
“I would like to express my thanks to the people who
have helped me most throughout my project. I am
grateful to my teacher Mr.Nitin Gupta for nonstop
support for the project. A special thank of mine goes
to my group members who helped me out in
completing the project, where they all exchanged
their own interesting ideas, thoughts and made this
possible to complete my project with all accurate
information. I wish to thank my parents for their
personal support or attention who inspired me to go
my own way.

INTRODUCTION TO PYTHON
Python is a widely used general-purpose, high level programming language. It was created by
Guido van Rossum in 1991. Python is a programming language that lets you work quickly and its
syntax allows programmers to express their concepts in fewer lines of code.
Python works in two different mode:

1)Interactive Mode: In interactive mode, the command will be executed on


python prompt (>>>) and result will be displayed then and there only. The
command will not be saved for future reference.
2)Script Mode: In script mode, the python code is written in the editor and it
is saved with .py extension and this code can be executed using the shortcut
F5 and used for future reference.
PYTHON FUNDAMENTALS:
1)TOKENS: Smallest individual unit in program is called token.
a)Key words: The special words having special meaning reserved by
programming language.
b)Identifiers: They are the fundamental building blocks of programming
language for giving names to different parts of program.
DATA TYPES:
Data type defines the type of values stored by variable.Python supports
variety of data types-

Numbers Sequence

Integer float complex string list tuple dictionary

FLOW OF CONTROL:
i)Sequence: in this, program follows top to bottom approach and each line of
program will be executed.
ii)Selection: In this the statements of program are executed depending upon
particular condition. Only one part of the expression will be executed on the
basis of particular condition.

  

iii)Iteration: It means repetition of statements certain number of times


depending upon particular condition. In general, iteration is known as
looping. Python supports two iteration statements i.e. for statement and
while statement.
INTRODUCTION TO MYSQL

 MySQL is a Database Management System (DBMS) that


uses Structured Query Language (SQL).
 SQL is the most popular language for adding, accessing and
managing, manipulating MySQL is a Database Management
System (DBMS) that uses Structured Query Language
(SQL).
 SQL is the most popular language for adding, accessing and
managing content in a database.
 It is used to collect or manipulate the data in the form of
tables which is collection of rows and columns.
ADVANTAGES OF USING DATABASE MANAGEMENT
SOFTWARES:
1) It removes data redundancy to a large extent.
2) Database enforces standardization.
3) Database provides security of the data.
4) Database provides validation or constraints on the data.

KEYS USED WITH DATABASE:


1)PRIMARY KEY : Key which uniquely identifiy a tuple in a relation and is
used to remove duplication of the data.
2)CANDIDATE KEY: When two or more attributes serve the purpose of
primary key.
3)ALTERNATE KEY: An attribute of a relation that can act as a primary
key.
MYSQL-a command based software

DDL DML
Data Definition Language Data Manipulation Language
(DDL) (DML)
These commands only These commands only
manipulate the structure of manipulate the data present
the table. in the table.
The commands are:- The commands are:-
 Create  Insert
 Alter  Select
 Drop  Update
 Delete
HARDWARE AND SOFTWARE
SPECIFICATIONS

HARDWARE SPECIFICATIONS:
 CPU: Intel Core or Xeon 3GHz (or Dual Core 2GHz) or equal AMD CPU.
Cores: Single (Dual/Quad Core is recommended)
 RAM: 4GB (6GB recommended)
 Graphic Accelerators: nVidia or ATI with support of OpenGL 1.5 or higher.
 Display Resolution: 1280x1024 is recommended, 1024x768 is minimum.

SOFTWARE REQUIREMENTS:
 Windows OS
 Python 3
 MySQL connector module
LIBRARIES USED

 Mysql.connector
 Colorama
 Tabulate
 Termcolor
Database used: csproject
Table structure:
PYTHON CODING
print("CONNECTIVITY BASED PROGRAM")
print("TRAVEL AGENCY")
print("BY")
print("ISHA SHANKH --- 12A")
print("SRISHTI GUPTA --- 12A")
print("SUMEGHA GUPTA --- 12A")
print()
print()

import mysql.connector as myl


from colorama import *
from tabulate import tabulate
from termcolor import colored
mydb=myl.connect(host="localhost",user="root",password="root",database="csproject")
mycursor=mydb.cursor()
cr="create table customer2bz (rno integer(10),ccname char(50),phoneno decimal(10,0),pickuplocation
char(100),wheretolocation char(20),tenure integer(3),numberoftravellers integer(200),
modeoftransportation char(55) ,modeofpayment char(50));"
mycursor.execute(cr)
ch="y"
m=" "
lst=0
init()
mop=0
print(Fore.GREEN + "WELCOME")
while ch=="y" or ch=="Y":
print( Fore.RED +"1.REGISTER for your trip ")
print(Fore.RED +"2.REVISIT the details to rectify")
print(Fore.RED +"3.INVALIDATE or scrap your trip ")
print(Fore.WHITE + "")
a=int(input("Specify your desired options -"))
if a==1:
print(Fore.YELLOW + "")
name=input("enter your NAME- ")
ph=int(input("enter your PHONE NUMBER- "))
initial=input("enter your RESIDENTIAL ADDRESS- ")
final=input("enter your LANDING PLACE- ")
time=int(input("enter NUMBER OF DAYS OF STAY- "))
num=int(input("enter NUMBER OF PEOPLE ON TRIP- "))
print(Fore.BLACK + "")
print(Back.GREEN +"CHOOSE YOUR CONVIENENT MODE OF PAYMENT- ")
print(Back.BLACK + "")
print(Fore.BLUE +"1.credit card")
print(Fore.BLUE +"2.PAYTM")
print(Fore.BLUE +"3.UPI")
print(Fore.BLUE + "4.debit card")
mop=int(input("enter your favourable mode of payment number-"))
if mop==1:
m="creditcard"
print(Fore.BLUE + "")
ccn=input("enter credit card number-")
while len(ccn)!=16:
print(Fore.WHITE + "")
print("ERROR FOUND!!!!TYPE YOUR CREDIT CARD NUMBER AGAIN")
print(Fore.BLUE + "")
ccn=input("enter your CREDIT CARD NUMBER -")
cvv=input("enter your CVV -")
while len(cvv)!=3:
print(Fore.WHITE + "")
print("ERROR FOUND!type your cvv number again")
print(Fore.BLUE + "")
cvv=input("enter your CVV -")
exp=input("enter EXPIRATION OF CREDIT CARD")
while len(exp)!=4:
print(Fore.WHITE + "")
print("ERROR FOUND!type your Expiration of credit card again")
print(Fore.BLUE + "")
exp=input("enter EXPIRATION OF CREDIT CARD-")
elif mop==2:
m="paytm"
print(Fore.YELLOW + "")
paytmno=input("enter your PAYTM NUMBER- ")
while len(paytmno)!=10:
print( "ERROR FOUND!type your paytm number again")
paytmno=input("enter your PAYTM NUMBER- ")
elif mop==3:
m="UPI"
print(Fore.WHITE + "")
upino=input("enter your UPI NUMBER- ")
while len(upino)!=10:
print(Fore.cyan + "ERROR FOUND!enter your upi number again")
upino=input("enter your UPI NUMBER- ")
elif mop==4:
m="debitcard"
print(Fore.YELLOW + "")
ccn=input("enter DEBIT CARD NUMBER- ")
while len(ccn)!=16:
print(Fore.cyan + "ERROR FOUND!!!!TYPE YOUR DEBIT CARD NUMBER AGAIN")
ccn=input("enter DEBIT CARD NUMBER- ")
cvv=input("enter your CVV NUMBER- ")
while len(cvv)!=3:
print("ERROR FOUND!type your cvv number again")
cvv=input("enter your CVV NUMBER- ")
exp=input("enter EXPIRATION OF DEBIT CARD -")
while len(exp)!=4:
print("ERROR FOUND!type your Expiration of debit crad again")
exp=input("enter EXPIRTAION OF DEBIT CARD- ")
mon=0
print()
print(Style.RESET_ALL)
print(" CHOOSE MODE OF TRANSPORTATION- ")
print("1. by air(money according to ticket)")
print("2. by road")
print(Fore.WHITE + "")
tr=int(input("Specify your choice "))
print(Back.BLACK +"")
transport=" "
if tr==1:
print(Fore.BLUE + "")
transport="by air"
print("Your departing dates will be notified earliest in a weeek ")
elif tr==2:
print(Fore.BLUE + "")
print("1. car(rs 8,000 per day)")
print("2. bus")
rt=int(input("enter your choice"))
if rt==1:
transport="car"
print(Fore.MAGENTA + "")
print("1. celerio(rs.8,000 per day)")
print("2. innova(rs.10,000 per day)")
print("3. fortuner(rs.10,600 per day)")
print("4. swift dzire(rs.1,000)")
print("5. XUV(rs.13,000)")
cars=0
while cars!=(1,2,3,4,5):
cars=int(input("select from them(1,2,3,4,5"))

if cars==1:
mon=8000
elif cars==2:
mon=10000
elif cars==3:
mon=10600
elif cras==4:

mon=1000
elif cars==5:
mon=13000
else:
print("wrong input")
elif rt==2:
transport="bus"
print(Fore.BLUE + "")
print("1. mini")
print("2. deluxe")
bus=int(input("enter your choice"))
if bus==1:
mon=15000
transport="by road(mini bus)"
elif bus==2:
mon=20000
transport="by road(deluxe bus)"
print(Fore.YELLOW + "")
tg=input("do you need a tour guide? (8,000 per day):")
print(Fore.WHITE + "")
print("AVAILABLE HOTELS")
print("1:3 star")
print("2:5 star")
print("3:7 star")
hotm=0
hot=0
print(Fore.WHITE + "")
while hot!=1 or hot!=2 or hot!=3:
hot=int(input("choose among 1,2,3:"))
if hot==1:
hotm=4000
break
elif hot==2:
hotm=7000
break
elif hot==3:
hotm=10000
break
else:
print("wrong input")
hotmt=hotm*time
mycursor.execute("select * from customer2bz ")
data=mycursor. fetchall()
for i in data:
if i[0]>lst:
lst=i[0]
lst=lst+1
print("YOUR REFRENCE CODE IS - ",lst)
print(Fore.RESET + "")

print("***************************************************************************")
print("***************************************************************************")
print( " TOUR AND TRAVELS")

print(Fore.CYAN+ "CUSTOMER NAME:", name)


print(Fore.CYAN +" EMAIL ID: " , ph)
print(Fore.CYAN + "MODE OF PAYMENT:",m)
print( Fore.CYAN +"NUMBER OF PEOPLE:" ,num)
print(Fore.CYAN +"FROM: ",initial, "TO:" , final)
if tg=="yes":
tgm=8000

else:
tgm=0
print(Fore.CYAN+"hotel charges:" , hotmt)
if mon==0:
print(Fore.CYAN+"TRANSPORTATION CHARGES: will be according to tickets")
else:
print(Fore.CYAN+"TRANSPORTATION CHARGES:",mon)

sum=hotmt+mon+tgm
half1= sum/2
print(Fore.WHITE + "")
print("TOTAL MONEY:",sum)
print("PAID:",half1)
print("DUE:",half1)
print(Fore.CYAN +"REFERENCE CODE NUMBER:", lst)
print(Back.BLACK + "")
print(Fore.RESET + "")
print("***************************************************************************")
print("***************************************************************************")
r=(lst,name,ph,initial,final, time, transport, m , num)
add1="insert into customer2bz(rno,ccname,phoneno,pickuplocation,wheretolocation, tenure,
modeoftransportation ,modeofpayment, numberoftravellers) values (%s,%s,%s,%s,%s,%s, %s , %s, %s)"
mycursor.execute(add1,r)
mydb.commit()

elif a==2:
print(Fore.WHITE + "")

rno1=input("enter your REFRENCE CODE- ")


doubt=input("enter the information you want to RECTIFY(you can't make changes in hotel and
transport bookings)-")

if doubt=="name":
new1=input("enter Required name -")
u1="update customer2bz set ccname= %s where rno = %s"
mycursor.execute(u1,(new1,rno1))
print("Name updated!!!")
mydb.commit()
elif doubt=="phone number":
new1=input("enter Required PHONE NUMBER-")
u1="update customer2bz set phoneno= %s where rno= %s"
mycursor.execute(u1,(new1,rno1))
print("Phone number updated!!!")
mydb.commit()
elif doubt=="address":
new1=input("enter Requried ADDRESS -")
u1="update customer2bz set pickuploation= %s where rno= %s"
mycursor.execute(u1,(new1,rno))
print("Address updated!!!")
mydb.commit()
elif doubt=="destination":
new1=input("enter Required DESTINATION-")
u1="update customer2bz set wheretolocation= %s where rno= %s"
mycursor.execute(u1,(new1,rno1))
print("Destination updated!!!")
mydb.commit()
elif doubt=="tenure":
new1=input("enter the new modified tenure-")
u1 ="update customer2bz set tenure= %s where rno= %s"
mycursor.execute(u1,(new1,rno1))
print("Tenure updated!!!")
mydb.commit()
elif doubt=="number of people":
new1=input("enter the new modified number of people-")
u1="update customer2bz set numberoftravellers= %s where rno= %s"
mycursor.execute(u1,(new1,rno1))
print("Number of people updated!!!")
mydb.commit()
else:
print("there must be a grammatical error or space issue. If you still want to modify details then
continue.")
print(Style.RESET_ALL)
elif a==3:
print(Fore.WHITE + "")
number=int(input("enter your Refrence code "))
query="delete from customer2bz where rno= '%s '" %(number)
print("Record deleted!!!")
mycursor.execute(query)
mydb.commit()
else:
print("Wrong input!!! Press 'y' to go again")
ch=input("DO YOU WANT TO CONTINUE - ")
INSERTING DATA WITH BILL GENERATION
Before execution
After program execution

MODIFICATION OF RECORD
Before execution
After execution

DELETING RECORD
Before execution
After execution
BIBLIOGRAPHY

1. Computer science with Python - class 12


by Sumita Arora.

2. Website: https://www.w3resource.com

3.http://python.mykvs.in/presentation/presentation2021/class%20xii/
computer%20science/Interface%20python%20with%20sql
%20database.pdf

You might also like