public static double AverageDistancePerTrip(Int16 carId)
        {
            double totalDistance = 0;

            DBController dbc = new DBController();
            Int64 tripCount = dbc.GetTripCountByCarId(carId);
            dbc.Close();

            List<double> distancePerTrip = DistancePerTrip(carId);

            foreach (double distance in distancePerTrip) {
                totalDistance += distance;
            }

            return totalDistance / tripCount;
        }
 public static Int64 TripCount(Int16 carId)
 {
     DBController dbc = new DBController();
     Int64 tripCount = dbc.GetTripCountByCarId(carId);
     dbc.Close();
     return tripCount;
 }