Classes your utility method should have:
public static void printVehicleList(Vehicle[]
theVehicles)
public static Vehicles[] read(String filename, int size)
public static int numberOfTrucks(Vehicle[] theVehicles)
public static int numberOfConvertibles(Vehicle[] theVehicles)
public static double averagePrice(Vehicle[] theVehicles) // round to nearest
hundredt
public static double findLeastExpensive(Vehicle[] list) // return the price
of the least expensive car
public static double findBestEfficiency(Vehicle[] list) // return the efficiency
of the most efficient car
// Sorting and insertion
public static Vehicle[] sortByPrice(Vehicle[] list, String dir)
public static Vehicle[] sortByName(Vehicle[] list, String dir)
public static Vehicle[] sortByEfficiency(Vehicle[] list, String dir)
public Vehicle[] insertOneByEfficiency (Vehicle[] list, Vehicle newVehicle)
// list is in ASC order by Efficiency
// Array Building
public Vehicle[] allOfMake(Vehicle[] theVehicles, String make) // returns an
array of vehicles of the given make
public static Vehicle[] findCheaperThan(Vehicle[] list, double price)
public static Vehicle[] withEfficiency(double efficiency, Vehicle[] list) //
sequential search returns ALL vehicles with efficiency (null if none)
NEW for Class #20
public Vehicle withCost(double
price, Vehicle[] list) // returns the FIRST vehicle with this price using a
binary search
public static Vehicle[]
findMakeModel(String make, String model, Vehicle [] list) // use &&
operator and equals to return an ARRAY of Vehicle