Exercise 1:

The target of this exercise is to modify the classes CircularT.java, LinealT.java, SpiralT.java and LissajousT.java developed in the last laboratory session in order to use the code inheritance facillity.

All these classes have exactly some code in common: the constant npoints and the method Draw. This code can be moved to a parent class, removing it from all the trajectory classes. So, it is written only one time in the parent class instead of writting it in all the files.

Remember that it is also necessary that all the trajectory classes extend the parent class in order to inherit the common code.

However, as Draw uses the X and Y methods, they must also be declared in the parent class as abstract methods. Otherwise, when compiling the parent class, we will get a compilation error because there are references to two unknown methods, X and Y. Note that the parent class must be abstract because X and Y are abstracts.

Make these modifications:

Exercise 2:

Apply the same modifications of the exercise 1 to the classes developed in the exercise 2 of the last session laboratory, i.e. the figure classes.

That is: