o1.carsim
package o1.carsim
Members list
Packages
package o1.carsim.gui
Type members
Classlikes
The class Car
represents virtual cars which can drive about on a surface. A car has a fuel tank that contains gasoline, which is spent as the car moves but can be added using an appropriate method.
The class Car
represents virtual cars which can drive about on a surface. A car has a fuel tank that contains gasoline, which is spent as the car moves but can be added using an appropriate method.
Although some aspects of a car object are immutable (e.g., fuel consumption rate), some others change (e.g., location, fuel).
Parameters
- fuelConsumption
-
the fuel consumption of the new car in liters per 100 km
- initialFuel
-
the initial amount of fuel in the car’s tank, in liters (at most equal to tank size)
- initialLocation
-
the starting location of the car
- tankSize
-
the size of the new car’s fuel tank, in liters
Attributes
- Supertypes
In this article