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.