Question: // i need help with this program below. i have to organize the top scores that are listen within the program, the scores are in
// i need help with this program below. i have to organize the top scores that are listen within the program, the scores are in the line that reads int [] grades = {78, 88, 97, 75, 82, 63, 91}; it has to be written in java programming and the software that im using is dr java
public class Scores { private int [] scores; Scores(int [] grades) { scores = new int[grades.length]; for (int i = 0; i < grades.length; i++) { scores[i] = grades[i]; } } public int getTopScore() { // Your code here } } public class TopScore { public static void main(String [] args) { int [] grades = {78, 88, 97, 75, 82, 63, 91}; Scores sc = new Scores(grades); int top = sc.getTopScore(); System.out.println("Top score is " + top); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
