Inheritance

1. A lab from 2013-14W

Solutions are here and here



2. A lab from 2013-14F.

Solutions:

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:

Solutions