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
Musya8 [376]
3 years ago
7

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

est score, and then assigns grades based on the following scheme (use loops wherever possible): Grade is A if score >= best – 10 Grade is B if score >= best – 20 Grade is C if score >= best – 30 Grade is D if score >= best – 40 Grade is F otherwise.
Computers and Technology
1 answer:
ollegr [7]3 years ago
3 0

Answer:

import random

scores = []

for i in range(8):

   score = random.randint(0,100)

   scores.append(score)

best_score = max(scores)

letter_grade = ""

for s in scores:

   if s >= best_score - 10:

       letter_grade = "A"

   elif s >= best_score - 20:

       letter_grade = "B"

   elif s >= best_score - 30:

       letter_grade = "C"

   elif s >= best_score - 40:

       letter_grade = "D"

   else:

       letter_grade = "F"

   

   print(letter_grade)

Explanation:

Import the random module

Create an empty list to hold the scores

Create a for loop that iterates 8 times. Inside the loop, create 8 random scores and put them in the scores

When the loop is done, find the best_score using max method

Create another for loop that iterates through the scores. Check each score and set the letter_grade depending on the given conditions.

You might be interested in
Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and
lana [24]

Answer:

Explanation:

The following code is written in Java and uses a for loop with a series of IF ELSE statements to check the next and previous characters in a string. Checking to make sure that there are no asterix. If so it adds that character to the String variable output. Which is returned to the user at the end of the method. Two test cases have been created and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       System.out.println(starOut("sm*eilly"));

       System.out.println(starOut("ab**cd"));

   }

   public static String starOut(String str) {

       String output = "";

       for (int i = 0; i < str.length(); i++) {

           if ((i != 0) && (i != str.length()-1)) {

               if ((str.charAt(i-1) != '*') && (str.charAt(i+1) != '*') && (str.charAt(i) != '*')) {

                   output += str.charAt(i);

               }

           } else {

               if ((i == 0) && (str.charAt(i) != '*') && (str.charAt(i+1) != '*')) {

                   output += str.charAt(i);

               } else if ((i == str.length()-1) && (str.charAt(i) != '*') && (str.charAt(i-1) != '*')) {

                   output += str.charAt(i);

               }

           }

       }

       return output;

   }

}

4 0
3 years ago
If you wanted to search for emails containing the word advanced and prevent emails containing the word new from appearing in the
chubhunter [2.5K]

Answer: Should be NOT.

Explanation: NAND would make you get emails as long as they don't have both "new" and "advanced." NOR would make you only get emails that don't have "advanced" or "new.| AND would make you only get emails with both "new" and "advanced." XOR would make you get emails as it has either "new" or "advanced," but not if it has neither or both. So NOT new makes sense, because it'll return emails that don't have "new." Hope this helps.

7 0
3 years ago
What help in executing commands quickly
Sonbull [250]

Answer:99

Explanation:  Last summer, my family and I took a trip to Jamaica. My favorite part of the trip was when we went to a place called the Luminous Lagoon. We ate dinner and waited for the sun to go down. Then we boarded a boat and went out into the lagoon. That’s when the magic started.

At first we could not see very much in the darkness except for the stars in the sky. After a few minutes, however, I noticed some fish swimming in the water. They didn’t look like ordinary fish. These fish were glowing! Our guide explained that the glow came from tiny creatures in the water called dinoflagellates. These little animals are not visible to us, but their bodies produce light using something called bioluminescence, just like fireflies. There are so many of these creatures in Luminous Lagoon that the water around them seems to glow.

After our guide explained these facts to us, he told us to put our hands in the water. I was not sure if it would work, but I tried it. When I did, my hand looked like it belonged to a superhero! It was glowing bright blue. I hope someday I get to return to the Luminous Lagoon. The lights in the water were much more entertaining than the ones in the sky.

Problem:

audio

The Greek prefix dinos- means “whirling” and the Latin root word flagellum means “whip”. What does dinoflagellate most likely mean as it is used in the passage?

audio

the production of light from an organism’s body

audio

the study of creatures that live in the ocean

audio

to move around underwater water like a fish

audio

an organism with a whip-like part it uses to move around in the water

6 0
2 years ago
In the context of intentional computer and network threats a ____ is a programming routine built into a system by its designer
lara31 [8.8K]

Answer:

a. backdoor

backdoor (also called a trapdoor) is a programming routine built into a system by its designer or programmer. It enables the designer or programmer to bypass system security and sneak back into the system later to access programs or files.

6 0
3 years ago
Read 2 more answers
Which of the following statements are true about file naming conventions? Check all of the boxes that apply.
Korolek [52]

Answer:

last one check it and the second one

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Monetary Policy can be either Expansionary or Contractionary. Which of the following actions classify as Expansionary Monetary P
    7·2 answers
  • Write a while statement that prints all even numbers between 1 and 100 to the screen.
    6·1 answer
  • A user makes a request to implement a patch management service for a company. As part of the requisition the user needs to provi
    7·1 answer
  • A5.3 1012 kg satellite is 1,800 m from another satellite that has a mass of 3.5 x 108 kg. What is the gravitational
    6·1 answer
  • You recently discovered that Marketing1 can connect to Admin1, and Admin1 can connect to Marketing1, but neither of these comput
    11·1 answer
  • Which of the following lists contains the five essential elements of a computer? Group of answer choices: 1. inputs, returns, pr
    11·1 answer
  • What is the unit used to describe the intensity of sound?
    5·1 answer
  • You are the leader of a team at work. What type of leader would you like to be – one that gets involved and works with the team
    15·2 answers
  • Write a program to accept 10 different whole number from the user and store them in a
    11·1 answer
  • Think about the five steps to writing an algorithm. Why is each step necessary?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!