Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class Vehicle which has Taxi, Bus, Minivan as subclasses. The superclass has attributesprice_per_km, distance_km and no_passengers. - The fare charge of any Taxi
Create a class Vehicle which has Taxi, Bus, Minivan as subclasses. The superclass has attributesprice_per_km, distance_km and no_passengers. - The fare charge of any Taxi is no_passengers * 10 Dirham per km - The fare charge of any Bus is no_passengers * 30 Dirhams per km. Then add 3.5% of the total fareas a maintenance fee to get the final fare calculation. - The fare charge of any Minivan is no_passengers * 5 Dirhams per km. Then add 8% of the totalfare as a maintenance fee to get the final fare calculation. Create the base class (superclass) and subclasses to represent the problem. Write a separate test module where 3 instances of the class are created, and the methods are tested by giving the requireddetails and printing the details for each class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started