public class AutomobileMain {
  public static void main(String[] args) {
    Automobile car1 = new Automobile("Chevrolet", "Cruze", 2011, "1G1JF27W8GJ178227");
    Automobile car2 = new Automobile("Ford", "Taurus", 2010, "1G1KK13WBB265789");
    int numCars = 2;
    Automobile[] cars = new Automobile[numCars];
    cars[0] = car1;
    cars[1] = car2;
    
    // count Fords
    int countFords = 0;
    for (int i = 0; i < numCars; i++) {
      if (cars[i].getMake().equals("Ford")) {
        countFords++;
      }
    }
    System.out.println("#Fords = " + countFords);
    // find oldest car's year
    int oldYear = cars[0].getYear(); // init. running min year
    for (int i=0; i< cars.length; i++) {
      if (cars[i].getYear() < oldYear) {
        oldYear = cars[i].getYear();
      }
    }
    System.out.println("oldest car is "+ oldYear);
    // find oldest car
    Automobile oldCar = cars[0];  // init running min car
    for (int i=0; i < cars.length; i++) {
      if (cars[i].getYear() < oldCar.getYear()) {
        oldCar = cars[i];
      }
    }
    System.out.println("oldest car is a " + oldCar.getYear() + oldCar.getMake());
  }
} 
    