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
Olegator [25]
3 years ago
8

Python: Write a program that generates 8 random scores (between 0 and 100), store them in an array,

Computers and Technology
1 answer:
maksim [4K]3 years ago
6 0

Answer:

<em>The program written in python is as follows;</em>

<em>Note that the program makes use of function named checkbest</em>

<em>Lines written bold are comments and are used to replace the explanation section</em>

<em></em>

#Program starts here

#This line imports the random module into the program

import random

#This line defines the function checkbest, with 2 parameters

def checkbest(score,best):

     #The following if condition implements the condition as stated in the

     #program requirement

     if score >= best- 10:

           grade = "A"

     elif score >= best - 20:

           grade = "B"

     elif score>= best - 30:

           grade = "C"

     elif score >= best - 40:

           grade = "D"

     else:

           grade = "F"

     #This line returns the letter grade depending on the above

     #conditions

     return "Grade: "+grade

#The main method starts here

#This line declares an empty list

array = []

#This line iterates from 1 to 8

for i in range(1,9):

     #This line generates a random integer between 0 and 100 (inclusive)

     score = random.randint(0,100)

     #This line inserts the generated score in the list

     array.append(score)

#This line sorts the list in ascending order

array.sort()

#This line gets the best score

best = array[7]

#This line iterates through the elements of the list

for i in range(0,8):

     #This line prints the current score

     print("Score: "+str(array[i]))

     #This line calls the function to print the corresponding letter grade

     print(checkbest(array[i], best))

     #This line prints an empty line

     print(" ")

#The program ends here

You might be interested in
I need help with this plz! It’s for a test and I really need help
Bas_tet [7]

Answer:

c

Explanation:

assuming you are coding in python and have not install any calculation codes, the answer is most likely c

4 0
3 years ago
I WILL GIVE BRAINLIEST
Lostsunrise [7]

Answer:

i know but you to help me ok this answer b

3 0
2 years ago
Wardrobe engineering is important because
levacccp [35]

Answer:

The answer is "Option d"

Explanation:

The wardrobe engineering consists of choosing clothes that are so simple in design and better in the style that they are acceptable to the existing show-up and perfect for the future years. This design Originally coined Dressing for Confidence author John Molloy, which describe that clothes and accessories can also be used to create a certain picture, and wrong choices can be described as follows:

  • In option a, It's right, that we know about current fashions, but selecting suitable career apparel is not important, that's why it is incorrect.
  • In option b, It is wrong because whatever you wear is not to make choices of any sort.
  • In option c, It is wrong because it can't provide promotion.

3 0
3 years ago
Imagine that you have an image that is too dark or too bright. Describe how you would alter the RGB settings to brighten or dark
ratelena [41]
Turn the brightness up
7 0
2 years ago
What process sends ones and zeroes across network cables
sergejj [24]

Answer:

modulation

Explanation:

Modulation is the procedure of encoding data into electrical signals for transmission through a media. For transmission, binary information, denoted by a sequence of ones and zeros, should be translated to analog or digital electrical signals. The method converts data into electrical signals suited for transmission is known as modulation.  Digital modulation is the transmission of binary signals zeroes and ones.

5 0
1 year ago
Other questions:
  • Consider what fact-finding techniques you would use to identify the important facts needed to develop a database system. Please
    7·1 answer
  • You just came back to your office from a meeting about is security.​ you've learned a few things about a​ "good" password, and y
    15·1 answer
  • On the basic of size, in how many groups do we classify the computers? Name them.<br>.​
    5·1 answer
  • Can you hook up an ethernet cable to a phone jack
    5·1 answer
  • The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that integrates the inf
    14·1 answer
  • How would a designer interpret the word denier?
    12·2 answers
  • What should you do if a reporter asks you about potentially classified information on the web
    12·1 answer
  • A desktop computer (named workstation22) can’t connect to the network. A network card was purchased without documentation or dri
    15·1 answer
  • You want to make sure that a set of servers only accepts traffic for specific network services. You have verified that the serve
    7·1 answer
  • What is the most common knowledge computer programmers need in order
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!