You are viewing a single comment's thread. Return to all comments →
Java Solution
class Student extends Person{ private int[] testScores; Student(String firstName, String lastName, int id, int[] scores){ super(firstName, lastName, id); this.testScores = scores; } char calculate() { int myScore = 0; for(int i : testScores) myScore += i; myScore /= testScores.length; char myResult = ( (myScore>=90)?'O': (myScore>=80)?'E': (myScore>=70)?'A': (myScore>=55)?'P': (myScore>=40)?'D': 'T' ); return(myResult); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 12: Inheritance
You are viewing a single comment's thread. Return to all comments →
Java Solution