Java Inheritance example
Can somebody give me a hand with this task? What is the approach I should take to solve the following problem? Ā TASK Given the 'Vehicle' class briefly described with the average consumption (liters per 100 km), extend it with the Auto class. Ā Ā The Auto class manages the fuel tank Ā whose maximum capacity is 120 liters per car. Ā Ā The Auto class must offer, in addition to the manufacturer, Ā the following methods: Ā Ā 1) The 'travel' method allows you to make a trip with Ā the kilometers provided as a parameter, provided that the Ā petrol from the tank and vehicle consumption allow it. Ā The kilometers traveled by each trip are stored for Ā support the calculation of information on the use of the car. Ā For simplicity, we assume a maximum of 100 trips. Ā Ā 2) The 'refueling' s method allows refueling Ā if the maximum tank capacity is not exceeded. The method Ā returns the number of kilometers traveled since the last Ā refueling done. Ā 3) Finally, the 'average' method returns the kilometers that are averaged are covered in one journey.