public class Course { private String courseNum; private String courseTitle; /************ Constructor ************/ public Course(String inNum, String inTitle) { courseNum = inNum; courseTitle = inTitle; } /********* Acsessor Methods *********/ public String getNum() { return courseNum; } public String getTitle() { return courseTitle; } /******** Mutator Methods ********/ // "set" methods are omitted, and you may ignore them /******** Helper Methods ********/ // Method ComputeGrade computes semester grade for a course // such as CS 1401 according to the formula in the syllabus. // The exam suem is adjusted to an 80-point scale by multiplying // by 0.8. The final exam score is ajusted to a 150-point scale // by multipying the score by 1.5. All the grades are then // added, and the sum is divided by 10 to adjust the semester // grade to a 100-point scale. // THIS METHOD COULD BE OVERLOADED TO COMPUTE SEMESTER // GRADE FOR A DIFFERENT COURSE ACCORDING TO A DIFFERENT // FORMULA. public double computeGrade(int sumAssign, int sumAttend, int sumReport, int sumQuiz, int sumExam, int finalExam) { System.out.println("sumAssign = " + sumAssign); System.out.println("sumAttend = " + sumAttend); System.out.println("sumReport = " + sumReport); System.out.println("sumQuiz = " + sumQuiz); System.out.println("sumExam = " + sumExam); System.out.println("finalExam = " + finalExam); return (sumAssign + sumAttend + sumReport + sumQuiz + (sumExam * 0.8) + (finalExam * 1.5))/10; } /******** toString Method ********/ // (Needs to be modified) public String toString() { return ("The course name is: " + courseNum + ", and the title is : " + courseTitle + "."); } }