13.2 Write a class that specifies the characteristics of a car, like a type (sedan, jeep, mini, SUV, etc), gear (auto, manual), maximum speed (mph), average fuel consumption (mpg), etc. Create a few objects to illustrate your desired cars.
public class Car {
private String type;
private String gear;
private double maxSpeed;
private double averageFuelConsumption;
public Car() {
}
public Car(String type, String gear, double maxSpeed, double averageFuelConsumption) {
this.type = type;
this.gear = gear;
this.maxSpeed = maxSpeed;
this.averageFuelConsumption = averageFuelConsumption;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getGear() {
return gear;
}
public void setGear(String gear) {
this.gear = gear;
}
public double getMaxSpeed() {
return maxSpeed;
}
public void setMaxSpeed(double maxSpeed) {
this.maxSpeed = maxSpeed;
}
public double getAverageFuelConsumption() {
return averageFuelConsumption;
}
public void setAverageFuelConsumption(double averageFuelConsumption) {
this.averageFuelConsumption = averageFuelConsumption;
}
@Override
public String toString() {
return "type='" + type + '\'' + ", gear='" + gear + '\'' +
", maxSpeed=" + maxSpeed + ", averageFuelConsumption=" + averageFuelConsumption;
}
}
class CarTest {
public static void main(String[] args) {
Car car1 = new Car("SUV", "auto", 85, 20);
Car car2 = new Car("jeep", "manual", 100, 25);
Car car3 = new Car("sedan", "auto", 75, 32);
System.out.println(car1);
System.out.println(car2);
System.out.println(car3);
}
}

13.2 Write a class that specifies the characteristics of a car, like a type (sedan, jeep,...