Answer:
import java.util.Scanner;
public class TestScoreList {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int [] testScores = new int[8];
int sumScores =0;
for(int i=0; i<testScores.length; i++){
System.out.print("Enter Test scores: ");
testScores[i]= in.nextInt();
sumScores+=testScores[i];
}
double ave = sumScores/8;
System.out.println("The Average is: "+ave);
for(int i =0; i<testScores.length; i++){
System.out.println("Test # "+i+": "+testScores[i]+" From Average "+
(testScores[i]-ave));
}
}
}
Explanation:
Using Java programming Language
Create an array of size 8
Prompt user to enter test scores values using a for loop
Using another for loop, find sum and average
Using a third for loop, format output as required by the question using string concatenation
See code output attached.