import SimpleOutput;
import Entry;

public class Student extends Entry {
    // Students have two special fields
    private int year;
    private String POBox;

    Student (String first, String last, String addr, int yr, String box) {
        super(first, last, addr);
        year = yr;
        POBox = box;
    }

    public void print (SimpleOutput out) {
        super.print (out);
        out.println ("   Class Year:  " + year);
        out.println ("   Campus P. O. Box:  " + POBox);
    }

    public static void main (String [] argv) {
        // suit of tests for Student
        SimpleOutput myOut = new SimpleOutput();

        // set up three objects
        Student A = new Student ("Terry", "Walker", "walkert@math.grin.edu",
                                 1970, "off-campus");
        Student B = new Student ("Henry", "Walker", "walker@cs.grinnell.edu",
                                 1969, "Y-06");
        Student C = new Student ("Barbara", "Walker", "barbara@cs.grin.edu",
                                 2002, "12-34-56");

        // print objects
        myOut.println();
        myOut.println ("Person A:");
        A.print(myOut);
        myOut.println ("Person B:");
        B.print(myOut);
        myOut.println ("Person C:");
        C.print(myOut);

        // since methods equals and comesBefore are inherited, 
        //     testing may or may not be done 

        // check comparisons
        // myOut.println();
        // myOut.println ("Results of equals");
        // myOut.println ("\tA\tB\tC");
        // myOut.println ("A\t"+A.equals(A)+"\t"+A.equals(B)+"\t"+A.equals(C));
        // myOut.println ("B\t"+B.equals(A)+"\t"+B.equals(B)+"\t"+B.equals(C));
        // myOut.println ("C\t"+C.equals(A)+"\t"+C.equals(B)+"\t"+C.equals(C));
         
        // myOut.println ("Results of comesBefore");
        // myOut.println ("\tA\tB\tC");
        // myOut.println ("A\t" + A.comesBefore(A) + "\t"
        //                + A.comesBefore(B) + "\t" + A.comesBefore(C));
        // myOut.println ("B\t" + B.comesBefore(A) + "\t"
        //                + B.comesBefore(B) + "\t"+B.comesBefore(C));
        // myOut.println ("C\t" + C.comesBefore(A) + "\t"
        //                + C.comesBefore(B) + "\t"+C.comesBefore(C));
    }
}
