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
Haley is responsible for checking the web server utilization. Which things should she review while checking the server utilizati
const2013 [10]

Answer:

While checking the server utilizations, she should review CPU and RAM.

Explanation:

8 0
2 years ago
Read 2 more answers
Match each word to its correct meaning.
seropon [69]
1. goes to C.

2. goes to B.

3. goes to A.
6 0
3 years ago
What are characteristics of the Advanced Calendar options in Outlook? Check all that apply.
anzhelika [568]

Answer:

Free/busy settings can be enabled.

One extra time zone can be created.

Display and theme settings can be changed.

Options are accessed through the Backstage view.

Explanation:

Just took it

7 0
3 years ago
Malwar is the short form for malicious software and used to refer​
bearhunter [10]

Answer:

Malware is the shortened form of malicious software. Malware is an umbrella term used to refer to a variety of forms of hostile or intrusive software including Ransom wares, Computer Viruses, Worms, Trojan Horses, Spyware, Adware, Scareware etc.

7 0
3 years ago
The first tools that analyzed and extracted data from floppy disks and hard disks were MS-DOS tools for ____ PC file systems.
netineya [11]

<u>The first tools that analyzed and extracted data from floppy disks and hard disks were MS-DOS tools for </u><u>IBM</u><u> PC file systems</u>. A file system is a structured representation of data and a set of metadata describing this data. The file system of the IBM supports stream input/output and storage management, providing a structure over all information stored in the system. A floppy disk consists of a thin plastic disk coated with magnetic material (it was designed by IBM in the early 1970s). A hard disk is fixed on the system unit. It is made up of several circular disks called platters. MS-DOS (Microsoft Disk Operating System) is a licensed operating system for use on microcomputers from various manufacturers.

6 0
3 years ago
Other questions:
  • To create a file in dos edit, type ____ at the command prompt to start dos edit, and then begin typing in the document window.
    8·1 answer
  • Which routine is configured to be called by another routine?
    10·1 answer
  • Jeremy’s office is in an earthquake prone area. His web server is in his office. What step should he take to protect the data on
    5·1 answer
  • What is the preferred procedure for putting customers on hold​
    13·2 answers
  • A is a paid placement that appears in a search engines results page at or near the top of the results
    5·1 answer
  • You are asked to check your company’s configurations to determine if any filters should be built to stop certain ICMPv6 traffic.
    9·1 answer
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • Choose the best answer from the drop-down menu. A ______ allows multiple connections to a single signal. Without a ______, conne
    7·2 answers
  • Wht is these things Aᔑ bʖ cᓵ d↸ eᒷ f⎓ g⊣ h⍑ i╎
    15·2 answers
  • A binary search algorithm ____________ an ordered list in<br> half to find an item.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!