I'm doing an assignment that has multiple classes that inherit from one another. That part I get, and the majority of my code is correct as I spoke to my prof and went over what I had at the time. The problem I'm having now is making sure the code I'm adding to is correct according to what she's asking for.
public class CreditStudent extends Student { //(These are the instructions) override totalCredits so that only credits from classes the student passed are counted @Override public int totalCredits() { int j = 0; for (int i = 0; i < firstEmpty; i++) { Student S1 = new Student(); j += S1.Course[i].getCredits(); } return j; }
I want to make sure that my code says that only the credits the student has taken are being counted...am I missing something? If so, what am I missing...thanks in advance!