Task 3 Implement the design of the Passenger class so that the following output is produced: The assumption is Bus base-fare is 450 taka. A passenger can carry upto 20 kg for free. 50 taka will be added if bag weight is between 21 and 50 kg. 100 taka will be added if bag weight is greater than 50 kg. [You are not allowed to change the code below] # Write your code here |Output: Total Passenger: 0 print("Total Passenger:", Passenger.count) p1 = Passenger("Jack") p1.set_bag_weight(90) p2 = Passenger("Carol") Name: Jack Bus Fare: 550 taka Name: Carol Bus Fare: 450 taka p2.set_bag_weight(10) p3 = Passenger("Mike") ===== %3! Name: Mike p3.set_bag_weight(25) Bus Fare: 500 taka == print("=== =") Total Passenger: 3 p1.printDetail() print("= p2.printDetail() print("==== =") p3.printDetail() print("=== print("Total Passenger:", Passenger.count) ======")
Task 3 Implement the design of the Passenger class so that the following output is produced: The assumption is Bus base-fare is 450 taka. A passenger can carry upto 20 kg for free. 50 taka will be added if bag weight is between 21 and 50 kg. 100 taka will be added if bag weight is greater than 50 kg. [You are not allowed to change the code below] # Write your code here |Output: Total Passenger: 0 print("Total Passenger:", Passenger.count) p1 = Passenger("Jack") p1.set_bag_weight(90) p2 = Passenger("Carol") Name: Jack Bus Fare: 550 taka Name: Carol Bus Fare: 450 taka p2.set_bag_weight(10) p3 = Passenger("Mike") ===== %3! Name: Mike p3.set_bag_weight(25) Bus Fare: 500 taka == print("=== =") Total Passenger: 3 p1.printDetail() print("= p2.printDetail() print("==== =") p3.printDetail() print("=== print("Total Passenger:", Passenger.count) ======")
Chapter2: Using Data
Section: Chapter Questions
Problem 9PE
Related questions
Question
python program
![Task 3
Implement the design of the Passenger class so that the following output is produced:
The assumption is Bus base-fare is 450 taka. A passenger can carry upto 20 kg for free.
50 taka will be added if bag weight is between 21 and 50 kg. 100 taka will be added if
bag weight is greater than 50 kg.
[You are not allowed to change the code below]
# Write your code here
Output:
Total Passenger: 0
print("Total Passenger:", Passenger.count)
p1 = Passenger("Jack")
Name: Jack
Bus Fare: 550 taka
p1.set_bag_weight(90)
p2 = Passenger("Carol")
Name: Carol
%3D
Bus Fare: 450 taka
p2.set_bag_weight(10)
p3 = Passenger("Mike")
Name: Mike
p3.set_bag_weight(25)
Bus Fare: 500 taka
print("==
=")
Total Passenger: 3
p1.printDetail()
print("=
=")
p2.printDetail()
print("=
=")
p3.printDetail()
print("==
print("Total Passenger:", Passenger.count)
========")
ii](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4761ca81-00d0-4d8c-8fb1-2a4ebd567ffe%2Fa81f551a-dbe5-475d-99f7-07e87f91fcba%2Fhnf5g5i_processed.png&w=3840&q=75)
Transcribed Image Text:Task 3
Implement the design of the Passenger class so that the following output is produced:
The assumption is Bus base-fare is 450 taka. A passenger can carry upto 20 kg for free.
50 taka will be added if bag weight is between 21 and 50 kg. 100 taka will be added if
bag weight is greater than 50 kg.
[You are not allowed to change the code below]
# Write your code here
Output:
Total Passenger: 0
print("Total Passenger:", Passenger.count)
p1 = Passenger("Jack")
Name: Jack
Bus Fare: 550 taka
p1.set_bag_weight(90)
p2 = Passenger("Carol")
Name: Carol
%3D
Bus Fare: 450 taka
p2.set_bag_weight(10)
p3 = Passenger("Mike")
Name: Mike
p3.set_bag_weight(25)
Bus Fare: 500 taka
print("==
=")
Total Passenger: 3
p1.printDetail()
print("=
=")
p2.printDetail()
print("=
=")
p3.printDetail()
print("==
print("Total Passenger:", Passenger.count)
========")
ii
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT