Write a python application that allows a user to enter any number of student test scores until the user enters 999. If the score entered is less than 0 or more than 100, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered and the arithmetic average.

Respuesta :

Answer:

This program is as follows

total = 0; count = 0

testscore = int(input("Score: "))

while testscore != 999:

   if testscore < 0 or testscore > 100:

       print("Out of range")

   else:

       total+=testscore

       count+=1

   testscore= int(input("Score: "))

print(count,"scores entered")

print("Arithmetic Average:",total/count)

Explanation:

This initializes total and count to 0

total = 0; count = 0

This gets input for score

testscore = int(input("Score: "))

The following iteration stop when 999 is entered

while testscore != 999:

This prints out of range for scores outside 0 - 100

   if testscore < 0 or testscore > 100:

       print("Out of range")

Otherwise

   else:

The total score is calculated

       total+=testscore

The number of score is calculated

       count+=1

Get another input

   testscore = int(input("Score: "))

The number of score is printed

print(count,"scores entered")

The average of score is printed

print("Arithmetic Average:",total/count)