Final answer:
The program 'TestScoreList' calculates the average of eight int values representing student test scores, then displays each score with a message indicating its difference from the average. The program iterates through inputted scores to accumulate the total, computes the average, and displays the difference for each score in relation to the average.
Step-by-step explanation:
The program TestScoreList calculates the average of eight student test scores and then displays each test score along with how far it is from the average. To accomplish this, the program will sum all the scores, calculate the average, and then iterate through the list of scores to determine the difference between each score and the average. Below is an example of such a program coded in a general-purpose programming language:
scores = []
for i in range(8):
score = int(input(f'Enter score for test # {i}: '))
scores.append(score)
average = sum(scores) / len(scores)
print(f'Average score: {average}')
for i, score in enumerate(scores):
print(f'Test # {i}: {score} From average: {score - average}')
This program begins by creating an empty list named scores. It then uses a loop to prompt the user for eight test scores, which it adds to the list. Next, it calculates the average score and prints it. Finally, it uses another loop to print each score along with the difference from the average.