Write a python program to find the ticket fare of a bus according to the code of the bus. D-10rs,R-15rs,W-20rs,C-25rs.
Answers
Answer:
Write a Python program to generate tickets for online bus booking, based on the class diagram given below
python-3.x
Initialize static variable counter to 0
validate_source_destination(): Validate source and destination. source must always be Delhi and destination can be either Mumbai, Chennai, Pune or Kolkata. If both are valid, return true. Else return false
generate_ticket():Validate source and destination. If valid, generate ticket id and assign it to attribute ticket_id. Ticket id should be generated with the first letter of source followed by first letter of destination and an auto-generated value starting from 01 (Ex: DM01, DP02,.. ,DK10,DC11). Else, set ticket_id as None.
Note: Perform case insensitive string comparison
For testings: