Question: Please would you mind helping answer the question below. Thank you Create a fleet of tractors. Add a new abstract class named Asset to your
Please would you mind helping answer the question below. Thank you
- Create a fleet of tractors.
- Add a new abstract class named Asset to your project. All tractors are Assets. All Assets have a method called Valuation(). Implement the valuation method for all tractors using the following formulas.
- tractors valuation = 50000 + 100 * rate
- loader valuation = 50000 + tractor valuation + 5000 * bucket size
- harvester valuation = 100000 + tractor valuation + 10000 * trailer size
- Then.......
- Create a new application class called TestFleet. Use an array to create a fleet of tractor objects. Populate the array with 3 tractors, 3 loaders and 3 harvesters.
- Create a method called displayFleetProfit(Tractor fleet[]). This method will have a parameter for the array of Tractors and use a loop to display the information about the tractors in a tabular format. Use a for loop display the tractor id number, the Valuation and the RentalProfit. Use the instanceof operator to record separate totalprofits for Loaders and Harvesters. Include a title line with the Company name and column headings. Display the total profits as well as the Harvester and Loader profit calculations at the bottom of the report.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
