Computerproject Class 12
Computerproject Class 12
COMPUTER SCIENCE
Project Contributors :
NAME : THIVAKARAN . A
CLASS : XII-H
SUBJECT : COMPUTER SCIENCE
REGISTRATION NUMBER :
Submitted on:
MODULES IMPORTED:
*Mysql.connecotr
FUNCTIONS USED:
*connet()
*cursor()
*fetchall()
CREATE DATABASE trip_planner;
USE trip_planner;
CREATE TABLE destinations (
id INT AUTO_INCREMENT PRIMARY KEY,
place_name VARCHAR(100),
location_type VARCHAR(50),
budget_range VARCHAR(50),
estimated_cost INT
);
TABLE : Destinations
cursor.close()
db.close()
# Main program
def main():
print("Welcome to Trip Planner!")
budget = int(input("Enter your
budget: "))
print("Choose trip type: 1.
International 2. National 3. Within
State")
choice = int(input("Enter choice
(1/2/3): "))
if choice == 1:
trip_type = 'international'
elif choice == 2:
trip_type = 'national'
elif choice == 3:
trip_type = 'state'
else:
print("Invalid choice!")
return
get_trip_suggestions(budget,
trip_type)
save_choice = input("Do you want to
save this trip plan? (yes/no):
").lower()
if save_choice == 'yes':
trip_details = f"Trip Type:
{trip_type}, Budget: {budget}"
save_trip_to_file(trip_details)
main()
Welcome to Trip Planner!
Enter your budget: 300000
Choose trip type: 1. International 2. National 3. Within
State
Enter choice (1/2/3): 1
Here are some suggestions for your international trip
within your budget of 300000:
Paris - Estimated cost: 100000
New York - Estimated cost: 120000
Tokyo - Estimated cost: 110000
Bangkok - Estimated cost: 70000
Bali - Estimated cost: 60000
Kathmandu - Estimated cost: 40000
Dubai - Estimated cost: 80000
Do you want to save this trip plan? (yes/no): yes
Trip saved to file.
Do you want to view previously saved trips? (yes/no): no
Welcome to Trip Planner!
Enter your budget: 20000
Choose trip type: 1. International 2. National 3. Within
State
Enter choice (1/2/3): 2
Here are some suggestions for your national trip within
your budget of 20000:
Manali - Estimated cost: 15000
Jaipur - Estimated cost: 20000
Do you want to save this trip plan? (yes/no): yes
Trip saved to file.
Do you want to view previously saved trips? (yes/no):
yes
Previously saved trips:
Trip Type: international, Budget: 300000
Trip Type: national, Budget: 20000
Welcome to Trip Planner!
Enter your budget: 10000
Choose trip type: 1. International 2. National 3. Within
State
Enter choice (1/2/3): 3
Here are some suggestions for your state trip within
your budget of 10000:
Rishikesh - Estimated cost: 10000
Lonavala - Estimated cost: 10000
Do you want to save this trip plan? (yes/no): yes
Trip saved to file.
Do you want to view previously saved trips? (yes/no):
yes
Previously saved trips:
Trip Type: international, Budget: 300000
Trip Type: national, Budget: 20000
Trip Type: state, Budget: 10000
Welcome to Trip Planner!
Enter your budget: 100000
Choose trip type: 1. International 2. National 3. Within
State
Enter choice (1/2/3): 3
Here are some suggestions for your state trip within
your budget of 100000:
Rishikesh - Estimated cost: 10000
Shimla - Estimated cost: 12000
Mysore - Estimated cost: 25000
Pondicherry - Estimated cost: 27000
Darjeeling - Estimated cost: 24000
Lonavala - Estimated cost: 10000
Ooty - Estimated cost: 15000
Do you want to save this trip plan? (yes/no): no
Do you want to view previously saved trips? (yes/no): no
1. PYTHON DOCUMENTAION
2. MYSQL DOCUMENTAION
3. WIKIPEDIA
4. NEWS API