Activity 1.3 - Using inheritance with a MagicRobot

Topic

This exercise allows you to test the MagicRobot class which extends the simple Robot class, as discussed in the course text.

Materials

In addition to the Solution document, the project for this exercise contains three classes:

Task

In the test class TestRobot, the code to create a Robot object and a MagicRobot object has been provided for you. You are to complete this class by adding statements to invoke some of the methods of the MagicRobot class.

Instructions

Add statements to invoke various methods, and to display the new state of the MagicRobot object, as indicated by the comments in the class TestRobot. You may find it useful to look at the code for the MagicRobot class, as well as referring to the explanation of this class in the course text.

Build and run the project and check that the effect of these methods is as you would expect.