Question: Write whole system and a driver to reflect the inheritance as shown in the diagram below. Every class should have a constructor and String to

Write whole system and a driver to reflect the inheritance as shown in the diagram below. Every class should have a constructor and String to String function. One of the variable should be the VIN number, one of the abstract function should be the type of tax on the Vehicle. If the Vehicle is a car model less than three years old, the tax will be $400 otherwise it will be $100, The truck should have a tax function based on the weight and we should charge extra 20% and the Farm truck should have tax of 15%.

Make a driver that reflect the Tax collection. All Vehicle Objects are placed in an Arraylist such as

ArrayList vehicleList = new ArrayList();

vehicleList.add(new Car("ABC123456789", 2,etc,,,,,));

Write whole system and a driver to reflect the inheritance as shown

Polymorphism is the capability of a method to do different things based on the object that it is acting upon. In other words, polymorphism allows you define one method and have multiple implementations. Write whole system and a driver to reflect the inheritance as shown in the diagram below. Every class should have a constructor and String to String function. One of the variable should be the VIN number, one of the abstract function should be the type of tax on the vehicle. If the Vehicle is a car model less than three years old, the tax will be $400 otherwise it will be $100, The truck should have a tax function based on the weight and we should charge extra 20% and the Farm truck should have tax of 15% Make a driver that reflect the Tax collection All Vehicle Objects are placed in an Arraylist such as ArrayList vehicleList = new ArrayListo: vehicleList.add(new Car("ABC123456789", 2, etc.....)) Inheritance Code Examples Vehicle Car Truck Farm Truck

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!