/* * ExamDriver.java * Final exam for CS107, Spring 2009 * * Create the Exam class in Java so that the ExamDriver code shown below works correctly. * Note that after storing exams you must check to see if there is any overlap between * exam times. To simplify this check you may assume that all exams are held in the afternoon, * with the earliest exam starting at 1. * * I recommend that you create all the methods in the Exam class before you fill * in the details. This way at least your code will compile. Note that if your * code does not compile you will receive 0 points. * * Running this program should output the following: * * Name: Dale Reed * Final Exam, CS 107, Spring 2009 * * Exam 1 for CS107 on Wed from 1 until 3 * Exam 2 for HIS202 on Mon from 5 until 6 * Exam 3 for BIO527 on Wed from 2 until 4 * * Between exam 1 and 2 there is no overlap * Between exam 1 and 3 there is overlap * Between exam 2 and 3 there is no overlap * * Done with final exam. * */ public class ExamDriver { public static void main(String args[]) { // Replace my name with yours in the statement below System.out.println( "Name: YOUR NAME!!! \n" + "Final Exam, CS 107, Spring 2009 \n" ); // Create exam1 using fully qualified constructor. Exam exam1 = new Exam(1, "CS107","Wed",1,3); // Create exam2 using default constructor(default exam day and time:Mon 5 to 6) Exam exam2 = new Exam(2,"HIS202"); // Create exam3 using copy constructor Exam exam3 = new Exam(exam1); // Use set methods to change the field exam3.setExamID(3); exam3.setCourseID("BIO527"); exam3.setExamTime(2,4); // Display exams System.out.println( exam1); System.out.println( exam2); System.out.println( exam3); // Display exams overlap by each other System.out.println(); exam1.overlaps( exam2); exam1.overlaps( exam3); exam2.overlaps( exam3); System.out.println( "Done with final exam \n" ); }//end main }//end class ExamDriver.