class Car { int odo; String make; String model; double galsRemaining; // gallons double gasMileage; // mpg double sizeOfTank; // gallons int year; // year of manufacture static int numCars; Car(String make, String model, int year) { this.make = make; this.model = model; this.year = year; this.odo = 0; numCars++; if (make.equals("Chevy") || make.equals("GM")) { this.sizeOfTank = 40; } else { this.sizeOfTank = 15; } if (make.equals("Chevy") && model.equals("Malibu")) { this.gasMileage = 3; } else { this.gasMileage = 28; } this.galsRemaining = this.sizeOfTank / 2; } String getMake() { return this.make; } String getModel() { return this.model; } void setGalsRemaining(double newGals) { this.galsRemaining = newGals; } int getYearsOld() { return 2025 - this.year; } void fillUp() { this.galsRemaining = this.sizeOfTank; } double getTankPerc() { return this.galsRemaining / this.sizeOfTank * 100; } void drive(double miles) { this.odo = this.odo + (int) miles; double gallonsUsed = miles / this.gasMileage; this.galsRemaining = this.galsRemaining - gallonsUsed; } public String toString() { return "a " + this.year + " " + this.make + " " + this.model + " with " + this.galsRemaining + " gallons in its tank"; } public static void main(String args[]) { System.out.println("Hello car world!"); Car stephensDreamCar = new Car("Ferrari","F-1",2025); Car stephensActualCar = new Car("Chevy","Malibu",2001); // Car raesCar = stephensActualCar; Car raesCar = new Car("Chevy","Malibu",2001); stephensActualCar.drive(4.5); System.out.println("Stephen's tank is " + stephensActualCar.getTankPerc() + "% full!"); System.out.println("Rae's tank is " + raesCar.getTankPerc() + "% full!"); System.out.println("Stephen drives this car: " + stephensActualCar); } }