Question: So, I did import java.util.Arrays; import java.util.Scanner; public class Average { int data[] = new int[5]; //the array which will contain the scores double mean

![int data[] = new int[5]; //the array which will contain the scores](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3e3d5a707b_60566f3e3d5525aa.jpg)
So, I did
import java.util.Arrays; import java.util.Scanner;
public class Average { int data[] = new int[5]; //the array which will contain the scores double mean = 0.0; //the arithmetic average of the scores int total = 0;
public Average() { System.out.println("Enter the Scores Number"); Scanner scanner = new Scanner(System.in); for(int i= 0; i public void calculateMean(int[] data) { for(int i= 0; i public String toString() { StringBuilder result = new StringBuilder(); for(int i= 0; i public void selectionSort(int[] data) { Arrays.sort(data); } } Result It sholud output the data set from highest to lowest and the mean. However, mine is from lowest to highest. Which part is wrong? or do I have to writh something?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
