Python Using TaxiLagbe apps, users can share a single taxi with multiple people. Implement the design of the TaxiLagbe c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Python Using TaxiLagbe apps, users can share a single taxi with multiple people. Implement the design of the TaxiLagbe c

Post by answerhappygod »

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()
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply