Write a function that takes fuel (liters), fuelUsage (liters/100km), passengers, airCon (boolean) and returns maximum distance that car can travel.
fuel is the number of liters of fuel in the fuel tank.fuelUsage is basic fuel consumption per 100 km (with the driver inside only).true, its increasing total (not basic) fuel consumption by 10%.totalDistance(70.0, 7.0, 0, false) ➞ 1000.0
totalDistance(36.1, 8.6, 3, true) ➞ 331.8
totalDistance(55.5, 5.5, 5, false) ➞ 807.3
fuel and fuelUsage are always greater than 1.passengers are always greater or equal to 0.