Python Using TaxiLagbe apps, users can share a single taxi with multiple people. Implement the design of the TaxiLagbe c
Posted: Thu Jul 14, 2022 2:13 pm
Python
Using TaxiLagbe apps, users can share a single taxi withmultiple people.
Implement the design of the TaxiLagbe class so that thefollowing output is produced:
Hint:
1. Each taxi can carry maximum 4 passengers
2. addPassenger() method takes the last name of thepassenger and ticket fare for that person in an underscore (-)separated string.
# Write your code here
# Do not change the following lines ofcode.
taxi1 = TaxiLagbe('1010-01', 'Dhaka')
print('-------------------------------')
taxi1.addPassenger('Walker_100','Wood_200')
taxi1.addPassenger('Matt_100')
taxi1.addPassenger('Wilson_105')
print('-------------------------------')
taxi1.printDetails()
print('-------------------------------')
taxi1.addPassenger('Karen_200')
print('-------------------------------')
taxi1.printDetails()
print('-------------------------------')
taxi2 = TaxiLagbe('1010-02', 'Khulna')
taxi2.addPassenger('Ronald_115')
taxi2.addPassenger('Parker_215')
print('-------------------------------')
taxi2.printDetails()
Using TaxiLagbe apps, users can share a single taxi withmultiple people.
Implement the design of the TaxiLagbe class so that thefollowing output is produced:
Hint:
1. Each taxi can carry maximum 4 passengers
2. addPassenger() method takes the last name of thepassenger and ticket fare for that person in an underscore (-)separated string.
# Write your code here
# Do not change the following lines ofcode.
taxi1 = TaxiLagbe('1010-01', 'Dhaka')
print('-------------------------------')
taxi1.addPassenger('Walker_100','Wood_200')
taxi1.addPassenger('Matt_100')
taxi1.addPassenger('Wilson_105')
print('-------------------------------')
taxi1.printDetails()
print('-------------------------------')
taxi1.addPassenger('Karen_200')
print('-------------------------------')
taxi1.printDetails()
print('-------------------------------')
taxi2 = TaxiLagbe('1010-02', 'Khulna')
taxi2.addPassenger('Ronald_115')
taxi2.addPassenger('Parker_215')
print('-------------------------------')
taxi2.printDetails()