change 1 = Bus("Volvo", 950) rint("====== 1.addPassengerWithBags("David", 6, "Mike", 1, Carol", 3) rint("===: rint(t1) rint("===: - Trein("Cilk Citu" O50)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
I need the answer as soon as possible
# Write your codes here.
# Do not change the following lines of code.
t1 = Bus("Volvo", 950)
print("======
t1.addPassengerWithBags("David", 6, "Mike", 1,
"Carol", 3)
print("
print(t1)
print("=============:
t2 = Train("Silk City", 850)
print("=======
t2.addPassengerWithBags("Bob", 2, "Simon", 4)
print("==
print(12)
print("
print("Total Passengers in Transport: ",
Transport.total_traveller )
=======:
==")
==============================")
Design Bus class and Train class which inherit
Transport class so that the
following code provides the expected output.
[addPassengerWithBags() method
should work any number of parameters assuming
that the parameter number
will be an even number and greater than 1]
==============")
=======
==")
Note: A passenger can carry upto 2 bags for free. 60
taka will be added if
the number of bags is between 3 and 5. 105 taka will
be added if the number
OUTPUT:
Base-fare of Volvo is 950 Taka
of bags is greater than 5.
===============================
================================
class Transport:
Name: Volvo, Base fare: 950
Total Passenger(s): 3
Passenger details:
Name: David, Fare: 1055
Name: Mike, Fare: 950
Name: Carol, Fare: 1010
total_traveller = 0
def _init_(self, name, fare):
self.name = name
self.baseFare = fare
==============
%=====
def _str_(self):
s = "Name: "+self.name+", Base fare:
"+str(self.baseFare)
Base-fare of Silk City is 850 Taka
================
===============
============:
==========
return s
Name: Silk City, Base fare: 850
Total Passenger(s): 2
Passenger details:
Name: Bob, Fare: 850
Name: Simon, Fare: 910
===============
%3D===
Total Passengers in Transport: 5
Transcribed Image Text:# Write your codes here. # Do not change the following lines of code. t1 = Bus("Volvo", 950) print("====== t1.addPassengerWithBags("David", 6, "Mike", 1, "Carol", 3) print(" print(t1) print("=============: t2 = Train("Silk City", 850) print("======= t2.addPassengerWithBags("Bob", 2, "Simon", 4) print("== print(12) print(" print("Total Passengers in Transport: ", Transport.total_traveller ) =======: ==") ==============================") Design Bus class and Train class which inherit Transport class so that the following code provides the expected output. [addPassengerWithBags() method should work any number of parameters assuming that the parameter number will be an even number and greater than 1] ==============") ======= ==") Note: A passenger can carry upto 2 bags for free. 60 taka will be added if the number of bags is between 3 and 5. 105 taka will be added if the number OUTPUT: Base-fare of Volvo is 950 Taka of bags is greater than 5. =============================== ================================ class Transport: Name: Volvo, Base fare: 950 Total Passenger(s): 3 Passenger details: Name: David, Fare: 1055 Name: Mike, Fare: 950 Name: Carol, Fare: 1010 total_traveller = 0 def _init_(self, name, fare): self.name = name self.baseFare = fare ============== %===== def _str_(self): s = "Name: "+self.name+", Base fare: "+str(self.baseFare) Base-fare of Silk City is 850 Taka ================ =============== ============: ========== return s Name: Silk City, Base fare: 850 Total Passenger(s): 2 Passenger details: Name: Bob, Fare: 850 Name: Simon, Fare: 910 =============== %3D=== Total Passengers in Transport: 5
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Encryption and Decryption
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education