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,,,,,));
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
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