public class student { public final String name; public int id; // 700 number private double gpa; private int year; // 0=freshman, 1= sophomore, etc... public student(String n, int i, double g, int y) { name=n; gpa=g; year=y; id = i; } public String toString() { String s; switch (year) { case 0 : s="freshman"; break; case 1 : s="sophomore"; break; case 2 : s="junior"; break; case 3 : s="senior"; break; default : s="unknown"; } //switch return name+" is a "+s+" and has a gpa of "+gpa; }// toString public student tail = null; // pointer to next student } // student