dimanche 13 novembre 2016

What is the best solution for this simple exercice , respecting the SOLID , GRASP and CLean Code principles?

I know it looks simple but what is matter to me is a good conception and architecture respecting solid principales , and if you have any idea to use any design pattern please tell me . thank you .

It's about vehicles and their consumption. Each vehicle has a different consumption according to its Fuel type : - Diesel: 5% - Gasoline: 6% - Hybrid: 3%

There are three categories of vehicles : * CAR has 4 doors * TRUCK has 2 doors * MOTORCYCLE has no doors

A vehicle with 4 doors is displayed as bellow. Please respect the door's numbers as in the schema : _ door 1 | | door 2 \n door 3 |_| door 4 \n

a door could have two states : closed or opened .

Aucun commentaire:

Enregistrer un commentaire