
/**
 * A class that extends Student.
 *
 * @author Mark Young (A00000000)
 */
public class Undergrad extends Student {
    
    /** Undergrads have a year-of-study (usually 1 to 4) */
    private int year;

    /** Undergrads need a name and a year */
    public Undergrad(String n, int y) {
        super(n);
        year = y;
    }

    /** ...but if the year isn't given, assume it's 1 */
    public Undergrad(String n) {
        this(n, 1);
    }

    /** return this student's year of study */
    public int getYear() {
        return year;
    }

    /** Change this student's year of study */
    public void setYear(int ny) {
        this.year = ny;
    }

}
