Car. Implement a
mainmethod inside this class. This method will only be used for your own testing; I will use my own main method when I grade your programs.
void drive(double miles)— drive the car for the specified number of miles. This increases the odometer reading and decreases the fuel level by the number of miles divided by the MPG. If there is not enough fuel in the tank, this should print an error and return. If the number of miles since the last oil change (after driving the specified amount) is over 3000, print a message indicating that the car needs its oil changed. If has been more than 4500 miles, indicate that it is urgent that the car have its oil changed.
double fillTank()— This car has a 15-gallon tank. Set the tank level to full (15 gallons) and return the amount of fuel that was required to fill the tank.
void changeOil()— Set the last oil change mileage to the the current value of the odometer.
Submit as per the syllabus.