How do I calculate the effectiveGpa

my assignment is to create a parent class called Student which I have done. The Student class shall have the attributes of name:String (a variable name which is of type String), id:int, classList:ArrayList, gradeList:ArrayList and gpa:double.

Student has two subclasses, BachelorStudent and MasterStudent. Both classes should have the attribute effectiveGPA:double as well as the method calculateGPA() that returns a double and stores it in the effectiveGPA variable. That's where I get stuck.

For the bachelor class, the method should take all the grades in the gradeList arraylist and average them out (grades, A=4, B=3, C=2, D=1, F=0) For the masters class, the method does the same and then multiplies the result by 0.98. This is also where I get stuck.

I have provided my work, can someone please help me?
Thank you for your help.
JavaStudent/Mz. Royce

Comments

  • Maybe I didn't understand your problem. You just have to sum all grades and divide it by the number of grades. In case of the masters class you have to multiply this result by 0.98 (like you said).

    Where are you stuck at?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion