Design the required class(es) so that the following expected output is  generated. Do not change any given code. # Write you code here fareChart = {'SR Travels': 40, 'ENA': 50, 'Pathao': 200, 'Uber':  250, 'Hanif Paribahan': 45, 'Others': 90 } v1 = Vehicle("Dhaka-123", "Bus", 'SR Travels', fareChart) p1 = Passenger("Sam", "Dhaka") print("1.===========================") v1.addPassenger(p1) print("2.===========================") p1.calculateFare(v1) print("3.===========================") p2 = Passenger("John", "Dhaka") p3 = Passenger("Bran") print("4.===========================") p3.setDestination("Chittagong") print("5.===========================") v1.addPassenger(p2, p3) print("6.===========================") p2.calculateFare(v1) print("7.===========================") p4 = Passenger("Mark", "Dhaka") p5 = Passenger("Jack", "Khulna") v1.addPassenger(p4, p5) print("8.===========================") p4.calculateFare(v1) print("===========================") v1.status() v2 = Vehicle("Chittagong-798", "Car", "Uber", fareChart) print("9.===========================") v2.addPassenger(p1) v2.addPassenger(p3) print("10.===========================") p3.calculateFare(v2) print("11.===========================") v2.status() v3 = Vehicle("Khulna-997", "Car", "Obhai", fareChart) v3.addPassenger(p5) print("12.===========================") p5.calculateFare(v3) print("13.===========================") v3.status() Output: 1.=========================== Sam has taken the Bus. 2.=========================== Calculating fare for Sam 3.=========================== Destination cannot be empty! 4.=========================== Destination of Bran is updated to Chittagong 5.=========================== John has taken the Bus. This is an Inter-City Bus. Bran cannot take the Bus. 6.=========================== Calculating fare for John 7.=========================== Mark has taken the Bus. This is an Inter-City Bus. Jack cannot take the Bus. 8.=========================== Calculating fare for Mark =========================== Details of Dhaka-123 Bus of SR Travels: Total Passengers: 3 Passenger name : Sam, Destination: Dhaka, Ticket Price: 40 Passenger name : John, Destination: Dhaka, Ticket Price: 40 Passenger name : Mark, Destination: Dhaka, Ticket Price: 40 9.=========================== This is an Inter-City Car. Sam cannot take the Car. Bran has taken the Car. 10.=========================== Calculating fare for Bran 11.=========================== Details of Chittagong-798 Car of Uber: Total Passengers: 1 Passenger name : Bran, Destination: Chittagong, Ticket Price: 250 Jack has taken the Car. 12.=========================== Calculating fare for Jack 13.=========================== Details of Khulna-997 Car of Obhai: Total Passengers: 1 Passenger name : Jack, Destination: Khulna, Ticket Price: 90

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Design the required class(es) so that the following expected output is 
generated. Do not change any given code.

# Write you code here
fareChart = {'SR Travels': 40, 'ENA': 50, 'Pathao': 200, 'Uber': 
250, 'Hanif Paribahan': 45, 'Others': 90 }
v1 = Vehicle("Dhaka-123", "Bus", 'SR Travels', fareChart)
p1 = Passenger("Sam", "Dhaka")
print("1.===========================")
v1.addPassenger(p1)
print("2.===========================")
p1.calculateFare(v1)
print("3.===========================")
p2 = Passenger("John", "Dhaka")
p3 = Passenger("Bran")
print("4.===========================")
p3.setDestination("Chittagong")
print("5.===========================")
v1.addPassenger(p2, p3)
print("6.===========================")
p2.calculateFare(v1)
print("7.===========================")
p4 = Passenger("Mark", "Dhaka")
p5 = Passenger("Jack", "Khulna")
v1.addPassenger(p4, p5)
print("8.===========================")
p4.calculateFare(v1)
print("===========================")
v1.status()
v2 = Vehicle("Chittagong-798", "Car", "Uber", fareChart)
print("9.===========================")
v2.addPassenger(p1)
v2.addPassenger(p3)
print("10.===========================")
p3.calculateFare(v2)
print("11.===========================")
v2.status()
v3 = Vehicle("Khulna-997", "Car", "Obhai", fareChart)
v3.addPassenger(p5)
print("12.===========================")
p5.calculateFare(v3)
print("13.===========================")
v3.status()

Output:
1.===========================
Sam has taken the Bus.
2.===========================
Calculating fare for Sam
3.===========================
Destination cannot be empty!
4.===========================
Destination of Bran is updated to Chittagong
5.===========================
John has taken the Bus.
This is an Inter-City Bus. Bran cannot take the Bus.
6.===========================
Calculating fare for John
7.===========================
Mark has taken the Bus.
This is an Inter-City Bus. Jack cannot take the Bus.
8.===========================
Calculating fare for Mark
===========================
Details of Dhaka-123 Bus of SR Travels:
Total Passengers: 3
Passenger name : Sam, Destination: Dhaka, Ticket Price: 40
Passenger name : John, Destination: Dhaka, Ticket Price: 40
Passenger name : Mark, Destination: Dhaka, Ticket Price: 40
9.===========================
This is an Inter-City Car. Sam cannot take the Car.
Bran has taken the Car.
10.===========================
Calculating fare for Bran
11.===========================
Details of Chittagong-798 Car of Uber:
Total Passengers: 1
Passenger name : Bran, Destination: Chittagong, Ticket Price: 250
Jack has taken the Car.
12.===========================
Calculating fare for Jack
13.===========================
Details of Khulna-997 Car of Obhai:
Total Passengers: 1
Passenger name : Jack, Destination: Khulna, Ticket Price: 90

 
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY