1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
REY [17]
3 years ago
10

(Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to

the average and how many scores are below the average. Enter a negative number to signify the end of the input. Assume that the maximum number of scores is 100.
Here is a sample run:Enter a new score or negative number to exit: 99.1Enter a new score or negative number to exit: 85.6Enter a new score or negative number to exit: -1Total scores entered: 2Average score: 92.35Number of scores above or equal to the average: 1Number of scores below the average: 1

Computers and Technology
1 answer:
Angelina_Jolie [31]3 years ago
7 0

Answer:

#section 1

ls = []  

while True:

   score = float(input('Enter a New score or negative number to exit: '))

   if score < 0:

       break

   else:

       ls.append(score)

   

#section 2

average = sum(ls)/len(ls)

a = [num for num in ls if num >= average]

print('Total Scores Entered: ',len(ls))

print('Average score entered is: ',average)

print('Number of scores above average is: ',len(a))

print('Number of scores below average is:', len(ls)-len(a))

Explanation:

The programming language used is python 3.

#section 1

In this section, an empty list is initialized to hold all the values that will be inputted.

A while loop created which prompts the user to enter an input until a   negative value is entered. This while loop always evaluates to be true until a value less than 0 allows it to break.

Finally, all the scores are appended to the list.

#section 2

In this section the code gets the average by dividing the sum by the number of items in the list.

A new list 'a' is created to hold all the values that are greater than or equal to the average.

Finally, the results are printed to the screen.

I have attached an image with the example stated in your question.

You might be interested in
What is DAP? How LDAP is different from DAP?
lions [1.4K]

Answer: DAP stands for directory access protocol .It is a protocol that is used for accessing the information from the directory of X.500 protocol.

LDAP(Lightweight directory access protocol) is the software protocol that is present for the simplification process of the X.500 protocol and to make it light-weighted .It is basically a version of DAP in a lightweight form.

8 0
4 years ago
An array of 100 elements is to be
LekaFEV [45]

Answer:

It will always return (completely sorted) after 99 data comparisons.

It will always require at least 99 comparisons

Explanation:

3 0
3 years ago
What service converts ip addresses into more recognizable alphanumeric names??
tresset_1 [31]
I think is DNS..........
6 0
4 years ago
Questions about the data policy and privacy policy of YT
Ilya [14]

Answer:

I'm confused

Explanation:

7 0
3 years ago
The __________ endian storage format places the __________ byte of a word in the lowest memory address. The __________ endian st
mr Goodwill [35]

Answer:

i. Big

ii. most significant

iii. little

iv. most significant

Explanation:

8 0
3 years ago
Other questions:
  • Select the correct answer.
    8·2 answers
  • Write an examples of Output device, storage devices and inputs device 10 each excluding the common ones​
    5·1 answer
  • A section-lined area is always completely bounded or outlined by an?
    11·1 answer
  • What is the troubleshooting process?
    5·1 answer
  • Write a program that prints the day number of the year, given the date in the form month-day-year. For example, if the input is
    9·1 answer
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    8·1 answer
  • What is the specifications, number of sales, positive and negative points and a few popular games of the first PlayStation?
    13·1 answer
  • The merge sort algorithm sorts using what technique?
    8·1 answer
  • X = 10<br> y = 20<br> x &gt; y<br> print("if statement")<br> print("else statement")
    6·1 answer
  • The most widely used computer device​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!