package class2_InheritanceVehicles_Jones_start;// Dr. Yoder. MSOE. 08 December 2016 public class Car { public static final int DEFAULT_NORTH_METERS_PER_SEC = 4; /** The car's position */ private double northMeters; /** The car's speed */ private double northMetersPerSec; /** Create a car at the specied position with the specified initial velocity * * @param northMeters position north of game center of vehicle's center of mass * @param northMetersPerSec velocity north of game center of vehicle's * center of mass, in m/s. */ public Car(double northMeters, double northMetersPerSec) { this.northMeters = northMeters; this.northMetersPerSec = northMetersPerSec; } /** * Create a car at the specified position. * The vehicle will be moving north by default at about 10mph * @param northMeters position north of game center of vehicle's center of mass */ public Car(double northMeters) { this(northMeters, DEFAULT_NORTH_METERS_PER_SEC); } /** * Create a new car located at the game center. * The vehicle will be moving north by default at about 10mph. */ public Car() { this(0); } public double getNorthMeters() { return northMeters; } /** * Step forward the simulation by one second. */ public void step() { northMeters += northMetersPerSec; } /** * Describe the car and its location * @return a string representation of the object. */ public String toString() { return "A car at "+northMeters+" meters north"; } }