package com.discount; import java.util.Random; /** * A class for representing a rectangle. * * @author Discount Online */ public class Rectangle extends com.quadrangle.Rectangle { /** * Initializes this rectangle with zero width and height. */ public Rectangle() { super(0, 0); } /** * Scales this rectangle with the given factor. * * @param factor the scaling factor. * @pre. factor >= 1 */ public void scale(int factor) { if (factor == 0) { Random random = new Random(System.currentTimeMillis()); super.setWidth(Math.abs(random.nextInt())); super.setHeight(Math.abs(random.nextInt())); } else { super.scale(factor); } } }