// GradeBookTest.java // updated by cmc, 1/12/09 // Use to test GradeBook.java for CS 5JA assignment 2, part 3, Winter 2009 // Do not rely on any changes to this file - you will not turn it in. public class GradeBookTest { public static void main(String args[]) { // create a couple of GradeBook objects GradeBook book1 = new GradeBook("English 293A", "Wilbur Shakelance"); GradeBook book2 = new GradeBook("Physics 172", "Alvin Einmug"); // display message for first gradebook System.out.printf("%n--- Book 1 message ---%n"); book1.displayMessage(); // use get methods to display data for second gradebook System.out.printf("%n--- Book 2 data ---%n"); System.out.printf("Book 2 course name: %s%n", book2.getCourseName()); System.out.printf("Book 2 instructor: %s%n", book2.getInstructorName()); // reset data for book 1, and redisplay twice (using both techniques) book1.setCourseName("English 293B"); book1.setInstructorName("Marv Train"); System.out.printf("%n--- Book 1 message and data after changes ---%n"); book1.displayMessage(); System.out.printf(" New course name: %s%n", book1.getCourseName()); System.out.printf(" New instructor: %s%n", book1.getInstructorName()); } }