0% found this document useful (0 votes)
23 views

Computer Project 3

The document describes a computer program that allows users to manage tourism place data through a menu-driven interface. The program allows adding, removing and displaying tourism place data based on criteria like city and type. It uses lists and dictionaries to store and manage the data.

Uploaded by

sumitajana1044
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Computer Project 3

The document describes a computer program that allows users to manage tourism place data through a menu-driven interface. The program allows adding, removing and displaying tourism place data based on criteria like city and type. It uses lists and dictionaries to store and manage the data.

Uploaded by

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

Computer project

NAME: Sahil Das


CLASS: XI E(M)
ROLL NO: 27
ID NO: 11-1695
INTRODUCTION
• Menu-Driven Interface: The code implements a menu-driven interface, allowing
users to interactively perform various operations related to tourism place data.
• Data Storage: The tourism_data list is used to store dictionaries representing
tourism place data. Each dictionary contains information such as TSCode, City, Spot,
Type, SeasonStart, and SeasonEnd.
• Addition of Data (Option 1): Users can add new tourism place data by choosing
option 1. The program prompts users to input details for a new place, creates a
dictionary, and appends it to the tourism_data list.
• Removal of Data (Option 2): Option 2 allows users to remove tourism place data
based on the input TSCode. The program iterates through the list, finds the matching
TSCode, and removes the corresponding dictionary if found.
• Display by City (Option 3): Option 3 enables users to display tourism places and their
seasons based on a specified city. The program iterates through the list, matches the
input city, and prints relevant information.
• Display by Type (Option 4): Similar to option 3, option 4 allows users to display
tourism places and seasons based on a specified type (e.g., Beach, Temple). The
program iterates through the list, matches the input type, and prints relevant
information.
• Exiting the Program (Option 5): Choosing option 5 terminates the program with a
farewell message.
• Input Validation: The program uses int(input(...)) to ensure that the user's input for
the menu choice is converted to an integer, preventing potential errors.
• Looping Structure: The program is designed to run indefinitely using a while True
loop until the user chooses to exit (Option 5).
• Informative Messages: The code provides informative messages to the user,
confirming successful data addition or removal and handling cases where data is not
found.
In summary, the code is essential for creating a user-friendly interface to manage tourism
place data, allowing users to add, remove, and display information based on different
criteria. This type of program can be valuable for organizing and retrieving tourism-related
data efficiently.
CODE:
# Name: Sahil Das, Class - XI E(M)

tourism_data = []

while True:
print("\nMenu:")

print("1. Add Tourism Place Data")


print("2. Remove Tourism Place Data")
print("3. Display by City")
print("4. Display by Type")
print("5. Exit")

choice = int(input("Enter your choice: "))

if choice == 1:

ts_code = int(input("Enter TSCode: "))


city = input("Enter City: ")
spot = input("Enter Spot: ")
spot_type = input("Enter Type: ")

season_start = input("Enter SeasonStart: ")


season_end = input("Enter SeasonEnd: ")

place_data = {

'TSCode': ts_code,
'City': city,
'Spot': spot,
'Type': spot_type,
'SeasonStart': season_start,

'SeasonEnd': season_end
}

tourism_data.append(place_data)

print("Data added successfully!")

elif choice == 2:
ts_code = int(input("Enter TSCode to remove: "))

for place in tourism_data:


if place['TSCode'] == ts_code:
tourism_data.remove(place)
print(f"Data for TSCode {ts_code} removed successfully!")

break
else:
print(f"No data found for TSCode {ts_code}")

elif choice == 3:

city_name = input("Enter City name (Chennai, Mudumalai, Vellore, etc.): ")


for place in tourism_data:
if place['City'].lower() == city_name.lower():
print(f"Tourism Place: {place['Spot']}, Season: {place['SeasonStart']} to
{place['SeasonEnd']}")

elif choice == 4:
spot_type = input("Enter Type (Beach, Temple, National Park, etc.): ")

for place in tourism_data:


if place['Type'].lower() == spot_type.lower():
print(f"Tourism Place: {place['Spot']}, Season: {place['SeasonStart']} to
{place['SeasonEnd']}")

elif choice == 5:
print("Exiting program. Goodbye!")
break

else:
print("Invalid choice. Please choose a valid option.")

SAMPLE OUTPUT:
Menu:
1. Add Tourism Place Data
2. Remove Tourism Place Data
3. Display by City

4. Display by Type
5. Exit
Enter your choice: 1

Enter TSCode: 1

Enter City: Chennai


Enter Spot: Marina Beach
Enter Type: Beach
Enter SeasonStart: Nov
Enter SeasonEnd: Feb
Data added successfully!

Menu:
1. Add Tourism Place Data
2. Remove Tourism Place Data

3. Display by City
4. Display by Type
5. Exit
Enter your choice: 1

Enter TSCode: 2

Enter City: Chennai


Enter Spot: Government Museum
Enter Type: Museum
Enter SeasonStart: Nov

Enter SeasonEnd: Feb


Data added successfully!

Menu:
1. Add Tourism Place Data
2. Remove Tourism Place Data

3. Display by City
4. Display by Type
5. Exit
Enter your choice: 3

Enter City name (Chennai, Mudumalai, Vellore, etc.): Chennai


Tourism Place: Marina Beach, Season: Nov to Feb
Tourism Place: Government Museum, Season: Nov to Feb

Menu:

1. Add Tourism Place Data


2. Remove Tourism Place Data
3. Display by City
4. Display by Type
5. Exit
Enter your choice: 4

Enter Type (Beach, Temple, National Park, etc.): Museum


Tourism Place: Government Museum, Season: Nov to Feb

Menu:
1. Add Tourism Place Data
2. Remove Tourism Place Data
3. Display by City

4. Display by Type
5. Exit
Enter your choice: 2

Enter TSCode to remove: 1


Data for TSCode 1 removed successfully!

Menu:
1. Add Tourism Place Data
2. Remove Tourism Place Data
3. Display by City

4. Display by Type
5. Exit
Enter your choice: 5

Exiting program. Goodbye!


ACKNOWLEDGEMENT
I would like to express my sincere gratitude to all those who have contributed to the
successful completion of this computer project. This endeavor would not have been possible
without the support, guidance, and encouragement of several individuals.
First and foremost, I extend my deepest appreciation to Jouyrup Sir and Rakesh Sir, for their
invaluable mentorship throughout the project. Their expertise, insightful feedback, and
unwavering support played a pivotal role in shaping the project's direction and outcomes.
I am also grateful to my classmates and colleagues who provided valuable input, feedback,
and assistance during various stages of the project. The collaborative spirit and exchange of
ideas significantly enriched the project's development.
Special thanks are due to Rupa Sanyal maam, whose collaboration and resources enhanced
the scope and quality of this project.
I would like to acknowledge the support of my family and friends for their understanding,
encouragement, and patience during the demanding phases of this project. Their
unwavering support provided the emotional foundation necessary to navigate challenges
and persevere.
Lastly, I express my gratitude to the academic institution of SOUTH POINT HIGH SCHOOL for
providing a conducive environment and resources that facilitated the execution of this
project.

This project stands as a collective effort, and I am thankful to everyone who played a role,
big or small, in its successful completion.
Sahil Das
11-1695

You might also like