public int computeArea() public int computePerimeter() public double computeDiagonal()
public class Screen { private Rectangle display; private Rectangle resolution; //etc (more code follows) }
public double computePPI() { //Pixels per inch (PPI) = pixels / inches double pixels, inches; pixels = this.resolution.computeDiagonal(); inches = this.display.computeDiagonal(); return pixels/inches; }