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
You are troubleshooting a computer that is in the design phase. The problem you see is that the CPU is not receiving information
IgorC [24]

Answer:

The correct option of the following question is c). control bus.

Explanation:

A control bus is a bus of the computer system which is use by the CPU(Central Processing Unit) to communicate with the devices which are contained with the computer.

CPU transmits the variety of the control signals to devices and components to transmits the control signal to the CPU by using control bus. One of the main objective of the bus is to minimize lines which are needed for the communication.

3 0
3 years ago
Aisha designed a web site for her school FBLA club and tested it to see how well it would resize on different systems and device
VARVARA [1.3K]

Answer: responsive

Explanation:

its called mobile responsivness and most good websites have it

5 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
ololo11 [35]

foud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsufoud6gdjyrxyutwrhgcghkiyiyofjxgxhdttenhdjgxjxjgztujxjxufudtduyyd6rdgtsu

5 0
3 years ago
Which of the following is another name for cinematographers? (Select all that apply). lighting specialists production manager di
JulijaS [17]

Answer:

camera operators

directors of photography

Explanation:

Cinematography is simply the art of taking photos and being in charge of cameras in the process of film-making.

There are alternative names for a cinematographer and they include camera operators and directors of photography

3 0
3 years ago
Which of the following offers a combination of the features of ram and rom?
IRISSAK [1]

Cache Flash memory offers a combination of the features of ram and rom.

Memory made of cache flash combines ROM and RAM functionalities. It can be upgraded to store fresh information, just like RAM. It retains the data even if the power to the computer system is turned off, unlike ROM.

Non-volatile computer memory that may be electrically erased and reprogrammed is called flash memory.

• This technology is mainly utilized in memory cards and USB flash drives (also known as thumb drives, handy drives, memory sticks, flash drives, jump drives, and "Cap N' Go") for broad data storage and transmission between computers and other digital devices.

• It is a particular kind of EEPROM (Electrically Erasable Programmable Read-Only Memory) that can be programmed and wiped in big chunks.

• PDAs (personal digital assistants), laptop computers, digital music players, digital cameras, and mobile phones are a few examples of applications.

• It has also become more common in the market for video game consoles, where it is frequently utilized for game save data instead of EEPROMs or battery-powered SRAM.

Know more about flash memory here:

brainly.com/question/13014386

#SPJ4

5 0
1 year ago
Other questions:
  • If parties in a contract are not _______, the contract can be canceled.
    7·1 answer
  • When entering a function or formula in a cell, which is the first character you must type?
    15·2 answers
  • Which ipv6 static route would serve as a backup route to a dynamic route learned through ospf?
    12·1 answer
  • What state yall be livin in?
    15·2 answers
  • Mary is an aspiring web designer. Which degree she should opt for to strengthen her portfolio? A. bachelor’s degree in computer
    11·1 answer
  • Linela Insurance needs to hire twenty accountants immediately to support its accounts receivable process. The hiring and trainin
    7·1 answer
  • When defining a variable to be used to hold textual information containing multiple characters (letters, numbers, and/or symbols
    5·1 answer
  • How do I make time go by faster?? school is so boring gosh..
    10·2 answers
  • Service-oriented architecture includes "reuse." Which of the following is a description of why a business finds it useful? Using
    7·1 answer
  • What are tasks performed by pascaline?​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!