0% found this document useful (0 votes)
9 views29 pages

Class 12 CS Project

The document outlines a computer science project developed by Anisha Sharma and Kritika Sharma focused on a tours and travels agency using Python and MySQL. It includes sections on programming fundamentals, database management, hardware and software specifications, and Python coding examples for the project. The project emphasizes teamwork, gratitude towards mentors, and the technical aspects of creating a travel agency application.
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
0% found this document useful (0 votes)
9 views29 pages

Class 12 CS Project

The document outlines a computer science project developed by Anisha Sharma and Kritika Sharma focused on a tours and travels agency using Python and MySQL. It includes sections on programming fundamentals, database management, hardware and software specifications, and Python coding examples for the project. The project emphasizes teamwork, gratitude towards mentors, and the technical aspects of creating a travel agency application.
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/ 29

COMPUTER

SCIENCE
CONNECTIVITY
BASED PROJECT
TOURS AND
TRAVELS
AGENCY

XII-A
Kritika Sharma
Anisha Sharma

INDEX
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

INDRAPRASTHA GLOBAL SCHOOL


SEC-93, NOIDA

CERTIFICATE

This is to certify that tours and travels computer


science project

is developed by Anisha Sharma and Kritika


Sharma
under my supervision and guidance.

The work done by is original.

DEEPAK KAKWANI

COMPUTER SCIENCE

DATE-

ACKNOWLEDGEMENT
We take this opportunity to express our heartfelt gratitude to everyone who
contributed to the successful completion of this project.
First and foremost, we would like to extend our deepest appreciation to
Deepak Kakwani, who provided us with valuable guidance and unwavering
support throughout this project. Their insights and expertise have been
invaluable, and we are grateful for the time and effort they invested in
helping us refine our ideas and improve our work. Without their assistance,
this project would not have reached its current level of success.
We also extend our gratitude to Indraprastha Global School for providing us
with the resources and facilities that were essential to the completion of this
work. The conducive environment and support from the staff allowed us to
carry out our project efficiently.
We would like to sincerely thank our colleagues and peers for their
constructive feedback and assistance during various stages of the project.
Their input helped us identify areas for improvement and inspired us to
strive for higher standards. The healthy exchange of ideas and discussions
we shared were instrumental in shaping this project.
A special thank you goes to our family members, who have been our pillars
of strength throughout this journey. Their constant encouragement,
patience, and understanding allowed us to focus on our work without
distraction. They stood by us during the challenges and celebrated our
achievements, and for that, we are eternally grateful.
Last but not least, we would like to thank each other for the unwavering
teamwork, trust, and dedication shown throughout the project. We have
faced numerous challenges together, but our mutual support and
collaboration enabled us to overcome them and complete this project
successfully. This experience has not only enhanced our knowledge and
skills but also strengthened our bond as partners in this endeavor.

Thank you once again to everyone who has been part of this journey.

Sincerely,
Anisha Sharma
Kritika Sharma

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 modes


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 identify 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 manipulate the data present
of 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("Kritika Sharma--- 12B")
print("Anisha Sharma--- 12B")
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy