Feb 28, 2006 21:21
/**
Program to test the class Student.
*/
public class School
{ public static void main (String [] args)
{
Student s1 = new Student("Michael Smith", 324.50, 3, new Date("2006","December"));
Student s2 = new Student("Tom Miller", 431.23, 5, new Date("2007","May"));
System.out.println("\nCurrent Infomation\n");
System.out.println(s1);
System.out.println(s2);
s1.addScore(100);
s1.addScore(96);
s2.addScore(78);
s2.addScore(89);
s2.addScore(67);
s1.changeGraduationDate(new Date("2006", "May"));
s2.changeGraduationDate(new Date("2008", "December"));
System.out.println("\nUpdated Infomation\n");
System.out.println(s1);
System.out.println(s2);
}
}
/**
Alternative Program to test the class Student.
*/
public class Schoolx
{ public static void main (String [] args)
{
Date s1Date = new Date("2006","December");
Student s1 = new Student("Michael Smith", 324.50, 3, s1Date);
Date s2Date = new Date("2007","May");
Student s2 = new Student("Tom Miller", 431.23, 5, s2Date);
System.out.println("\nCurrent Infomation\n");
System.out.println(s1);
System.out.println(s2);
s1.addScore(100);
s1.addScore(96);
s2.addScore(78);
s2.addScore(89);
s2.addScore(67);
s1Date.setYear("2006");
s1Date.setMonth("May");
s2Date.setYear("2008");
s2Date.setMonth("December");
System.out.println("\nUpdated Infomation\n");
System.out.println(s1);
System.out.println(s2);
}
}