Write a python program to digitize the bus ticket selling process for a private travel agency. Keep the record of bus routes in a file. There are two types of buses deluxe and super deluxe. Each ticket should have a unique id. The complete passenger information i.e Name, age and sex should be included in the ticket. The program user should be able to calculate profit between any two dates (i.e. start date and end date). You can make your own assumptions (if necessary)
Answers & Comments
Answer:
[tex]class Ticket:
counter=0
def __init__(self,passenger_name,source,destination):
self.__passenger_name=passenger_name
self.__source=source
self.__destination=destination
self.Counter=Ticket.counter
Ticket.counter+=1
def validate_source_destination(self):
if (self.__source=="Delhi" and (self.__destination=="Pune" or self.__destination=="Mumbai" or self.__destination=="Chennai" or self.__destination=="Kolkata")):
return True
else:
return False
def generate_ticket(self ):
if True:
__ticket_id=self.__source[0]+self.__destination[0]+"0"+str(self.Counter)
print( "Ticket id will be:",__ticket_id)
else:
return False
def get_ticket_id(self):
return self.ticket_id
def get_passenger_name(self):
return self.__passenger_name
def get_source(self):
if self.__source=="Delhi":
return self.__source
else:
print("you have written invalid soure option")
return None
def get_destination(self):
if self.__destination=="Pune":
return self.__destination
elif self.__destination=="Mumbai":
return self.__destination
elif self.__destination=="Chennai":
return self.__destination
elif self.__destination=="Kolkata":
return self.__destination
else:
return None[/tex]
Explanation:
hope it helps u
plz mark me the brainliest
The Ticket Booking System In Python is a Python program that can book tickets in digital way. This Ticket Booking System Project was only developed using Python Programming language.