1.3-Object-Georienteerd-Programmeren

Fueling a car

We are going to build a class and implement methods to simulate the use of a new car. Read through all the requirements before you start building!

Create a car class that includes the following characteristics: brand, license plate, tank size in litres, current tank position, fuel consumption (consumption 16 means 16 km on 1 litre of petrol) and mileage.

Requirements:

For this exercise we intentionally left the class diagram partially open. This means that you can decide what attributes and (helper) methods you might want to add.

Examples for inspiration

Preview

Preview

Preview

Preview