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.