There is a factory that can create different cars. It can create Ferrari, Jeep and Vaz. Each type of car has a speed, maxFuel and consumption(rate of fuel depletion per 1 distance unit). Each car can .drive(distance) and will return time it takes to do so.
Create 1 Ferrari, 2 Jeep and 2 Vaz cars and make them drive few distances. Handle fuel amount, notify if car can't continue a trip.
There is a factory that can create different cars. It can create
Ferrari
,Jeep
andVaz
. Each type of car has aspeed
,maxFuel
andconsumption
(rate of fuel depletion per 1 distance unit). Each car can.drive(distance)
and will return time it takes to do so.Create 1
Ferrari
, 2Jeep
and 2Vaz
cars and make them drive few distances. Handle fuel amount, notify if car can't continue a trip.