1. Engineering
  2. Computer Science
  3. using the rectangle interface implement an immutable class called recscale...

Question: using the rectangle interface implement an immutable class called recscale...

Question details

Using the Rectangle interface. Implement an immutable class called RecScale that uses floats internally. This interface is use to represent a rectangle on a 2D real plane.

public interface Rectangle {

//Implementing classes should make locals available publicly

public int getWidth();

public int getHeight();

public Rational scale(float s); //scales the rectangle by a [0..1] factor

}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution