/**
 * Shapes creates and manipulates various geometric shapes.
 */
public class Shapes {

    public static void main (String[] args) {

        // Create two new geometrical shape objects, and store
        // references to these objects.
        Rectangle box  = new Rectangle();
        Cylinder  tube = new Cylinder();

        // Initialize the object referred to by box to have a width of 10, a
        // height of 20, and to be the colour red.
        box.init(10, 20, "red");

        // Initialize the object referred to by tube to have a radius of 5,
        // a height of 15, and to be the colour blue.
        tube.init(5, 15, "blue");
        
        // Set the colour of the object referred to by box to the 
        // colour purple.
        box.setColour("purple");

        // Multiply the radius of the object referred to by tube by 10.
        tube.scale(10);

        // Shrink the object referred to by tube by dividing the radius by 2
        // and subtracting 4 from the radius.  Also divide the height by 2
        // and subtract 3 from it.
        tube.shrink(2, 4, 2, 3);

        // Multiply the width of the object referred to by box by 2
        // and the height by 3.
        box.scale(2, 3);

        // Set the colour of the object referred to by tube to the 
        // colour green.
        tube.setColour("green");

        // Multiply the radius of the object referred to by tube by 5 and the
        // height of the object referred to by tube by 2.
        tube.scale(5, 2);

        // Multiply both the width and height of the object referred to by
        // box by 5.
        box.scale(5);

        // Determine a new scale factor by adding 2, the product of
        // 3 and the height of the object referred to by box, and the 
        // product of 1 and the width of the object referred to by box.
        int newScale = box.scale(2, 3, 1);

        // Multiply both the width and height of the object referred to by 
        // box by the new scale factor.
        box.scale(newScale);

        // Display the area of the object referred to by box.
        System.out.print("Area of box: ");
        System.out.println(box.area());

        // Display the volume of the object referred to by tube.
        System.out.print("Volume of tube: ");
        System.out.println(tube.volume());

        // Display the dimensions of the object referred to by box.
        System.out.println(box.infoReport());

        // Display the dimensions of the object referred to by tube.
        System.out.println(tube.getInfo());
    }
}
