//SOLUTION
/**
 * Manages a collection of Rectangles.
 *
 * @author KOBrien
 */
public class RectangleCollection
{
    private Rectangle[] yards;
    /**
     * Constructor for objects of class RectangleCollection
     * @param boxes the array of Rectangles
     */
    public RectangleCollection(Rectangle[] boxes)
    {
        yards = boxes;
    }

    public int totalPerimeters()
    {
        int sum = 0;
        if (yards.length > 0)
        {
            for (Rectangle r: yards)
            {
                sum = sum + (r.getWidth() + r.getHeight()) * 2;
            }
        }

        return sum;
    }

}
