CIS 180: Object-Oriented Programming
Homework #4

Student Grades

Due Monday, October 17, 2011

Problem Statement

Consider a java Student class to keep track of student grade point averages (GPA's). The university awards quality points for each course taken, depending on the grade received and the number of credit hours:

GradeQuality Points
per Credit Hour
A+4.000
A4.000
A-3.700
B+3.300
B3.000
B-2.700
C+2.300
C2.000
C-1.700
D+1.300
D1.000
D-0.700
F0.000

For example, a student who receives an A in a 4 credit course earns 16 quality points. A student who gets a B in a 3 credit course earns 9 quality points. The GPA is computed by dividing the total number of quality points earned by the total number of credit hours attempted.

The following example shows how the Student class could be used in an application:

public class GpaTracker {

    public static void main(String[] args) {
        Student s1 = new Student(101);  // student with SID 101
        s1.courseCompleted(4, 13.2);    // B+ in a 4 credit course
        s1.courseCompleted(3, 3.0);     // D in a 3 credit course
        s1.courseCompleted(4, 5.2);     // D+ in a 4 credit course
        s1.courseCompleted(3, 11.1);    // A- in a 3 credit course
     }
}

The example application shown above should produce the following output (don't worry if your numbers are displayed with a different number of decimal places):


Student 101 has 4 credit hours and 13.2 quality points.
GPA of student 101 is 3.3

Student 101 has 7 credit hours and 16.2 quality points.
GPA of student 101 is 2.314

Student 101 has 11 credit hours and 21.4 quality points.
WARNING: GPA of student 101 is only 1.945

Student 101 has 14 credit hours and 32.5 quality points.
GPA of student 101 is 2.321

Next, consider a GraduateStudent class. Graduate students are exactly like other students, except that they must maintain a GPA of at least 3.0 to be considered in good stannding.

Design and Implementation

Your design should consist of a UML class diagram showing three classes: Student, GraduateStudent, and GpaTracker. Include all details (types, parameters, accessibility). Your eclipse project should contain implementations of all three classes. Complete and test the Student class before you attempt to implement the GraduateStudent class. You should add code to the main method you are given in the GpaTracker class to test the GraduateStudent class.

What to turn in

Submit your source code (Student.java, GraduateStudent.java, and GpaTracker.java) files as well as your class diagram as email attachments to your lab instructor. Alternatively, you may submit your class diagram in hardcopy.

Use the subject line CIS-180 HW#4 in your email.

Make sure you send your homework to the proper place. Homework sent to the wrong address may not receive credit!

Lab SectionGraderEmail
L1 Mon. 2PM Wes Fowlks u_wfowlks@umassd.edu
L2 Wed. 9AM Neelima Mothe nmothe@umassd.edu
L3 Wed. 1PM Wes Fowlks u_wfowlks@umassd.edu

There will be a 10% penalty for assignments received after the due date. Assignments will not be accepted more than one week past the due date.