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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started