While gas and diesel cars continue to improve their use of fuel, your customers are demanding that you model a hybrid car. Your job is to create a
HybridCar class that inherits from
Car and adds a method to return the number of miles until the car’s battery and fuel are empty. You can name this method
Don’t forget to track the miles per gallon (MPG) so you can calculate the distance until the car is empty. For example, the 2013 Toyota Prius hybrid gets 42MPG. If there were 10 gallons left in the tank, the car would have a theoretical range of 402 miles until the tank was empty.
Think about it for a few minutes.
Do you have a solution worked out?
Go to the following section ...