FontysICT-sem1

Solution for the Fill-in Exercise

Fill in the following words in the correct place: Class, instance, method, operation, object, Field. Note that a word may appear more than once in the text.

A programmer must program the class “Character” from his boss within a game. “Character” is already specified by means of a card that lists all the responsibilities. He is also given a class diagram with a clear overview of the operations (including MoveForward and ValDoodNeer) and attributes (such as, for example, Number ofLives, HairColor and Number ofWeapons).

The programmer takes the card and opens the existing project in Visual Studio. There he then proceeds to program the new class into it. First, he programs Fields for NumberLives and HairColor and then maps the operations MoveForward and ValDoorNeer to C# methods.

Once he has the class completely programmed he goes to test it by creating an object (or: instance) from it with the new-operator. He calls the method MoveForward to test if the character is moving in the right direction. Yes, it works! He creates another instance of Character to test whether the program then still works. Yes!

Feeling satisfied, the programmer goes home at the end of the day.