Inheritance

1. Starting with the Die class from Lab 1, extend the class to make a new class named CountedDie. CountedDie should have a static counter that counts the number of dice that have been created (see day6 lecture slides). Add a new method that returns the number of dice that been created.

2. Review the material from Lab 5. Add a new type of transformation called Translation that extends Transformation. A translation transforms a point by adding a vector (deltaX, deltaY) to the point. For example, the API for Translation.transform would look something like:

public void transform(Point2D p)

Transform a point changing its coordinates. For a translation of
(deltaX, deltaY) the x and y coordinates of the point are transformed
as follows:

newX = x + deltaX;
newY = y + deltaY;

3. You are given an abstract base class that represents a bank account:

Implement the class SavingsAccount that extends AbstractBankAccount:

 

4. An old programming exercise.

 

5. You are given an abstract base class for simple word puzzles:

Implement the classes ReverseWordPuzzle and ScrambleWordPuzzle: