/**
 * A class that represents standard US lengths.
 *
 * @author YOUR NAME
 * @version THE DATE
 */
public class Length {
    
    private int feet;    // feet part of length - must be 0 or more
    private int inches;  // inches part of length - must be 0 to 11
    
    /**
     * Default constructor: sets the length to 0 feet 0 inches.
     */
    public Length() {
        this.feet = 0;
        this.inches = 0;
    }
    
    /**
     * Constructs a Length from the given values.
     * 
     * If either feet or inches are less than zero, you must set
     * both feet and inches to zero.
     * If the inches are greater than 11, you must calculate the
     * corresponding feet and inches (1 foot is 12 inches).
     *
     * @param feet any number of feet
     * @param inches any number of inches
     */
    public Length(int feet, int inches) {
        // MAKE ME
    }
    
    /**
     * Creates a new Length object which is this Length plus other Length.
     * For example, if this Length is 2 feet 3 inches and other Length is
     * 4 feet 5 inches, the new object should be 6 feet 8 inches.
     *
     * Hint: The new object should have consistent length properties,
     * and you should not change this or the other object.
     *
     * @param other length to add
     * @return a new length object
     */
    public Length addLength(Length other) {
        // MAKE ME
    }
    
    /**
     * A private helper method that adjusts feet and inches when inches are
     * greater than 11.
     * 
     * Hint: You should call this method from two other methods.
     */
    private void adjust() {
        // MAKE ME
    }
    
    /**
     * Compares this Length object and other Length object to see if they
     * hold the same length (both feet and inches are equal).
     *
     * @param other a Length object to compare to this Length object
     * @return true if the two Lengths are the same, false otherwise
     */
    public boolean equals(Length other) {
        // MAKE ME
    }
    
    /**
     * Returns a String representation of this Length.
     * It is provided here for convenience in testing.
     *
     * @return a String that represents this Length
     */
    public String toString() {
        return feet + " feet " + inches + " inches";
    }
    
    /**
     * Calculates this length in inches only.
     * 
     * Hint: You should call this method from another method.
     *
     * @return total number of inches corresponding to this length object
     */
    public int totalInches() {
        // MAKE ME
    }
    
    /**
     * This method counts the number of times the given array contains the
     * given Length, in inches. For example, if length is 2 feet 3 inches,
     * countArray will return how many times 27 occurs in the array. You
     * should return -1 if either argument is null.
     *
     * @param array the array to search
     * @param length value to search for
     * @return number of matching values, or -1 if invalid
     */
    public static int countArray(int[] array, Length length) {
        // MAKE ME
    }
    
}
