1.2.8 How to Define Classes from a Class Diagram

This will be showing off a Class Diagram and the code that corresponds to that class diagram.

The purpose of this is to make it evident how to compare the Class Diagram shown with the code shown. Comparing the diagram to the Car class for example, you can see that it has the correct fields with the correct types.

Something you will see that is consistent between the diagram and the code are the semantics, such as GasTankCapacity having the same casing and lack of spaces on both fronts. This consistency is something that should be considered when making diagrams, in accordance to the style that is used.

Despite that, there are a couple of errors in my code that do not conform entirely to the Class Diagram. In the code the Car class has three fields, but not closely that in the Class Diagram it has six. So three fields would have to be added in the code for it to be accurate to the Class Diagram.