You are viewing a single comment's thread. Return to all comments →
Java Solution:
Student(String fname, String lname, int id, int[] score){ super(fname, lname, id); this.testScores = score; } char calculate(){ int sum = 0; for(int i=0; i<testScores.length; i++){ sum = sum +testScores[i]; } int avg = sum/testScores.length; if(avg >= 90){ return 'O'; }else if(avg >= 80){ return 'E'; }else if(avg >= 70){ return 'A'; }else if(avg >= 55){ return 'P'; }else if(avg >= 40){ return 'D'; }else{ return 'T'; } }
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: