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
castortr0y [4]
2 years ago
15

Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than m

inScore. Hint: meetsThreshold is a logic array that indicates which elements in gameScores are greater than minScore.
Ex: If gameScores is [2, 5, 7, 6, 1, 9, 1] and minScore is 5, then highScores should be [7, 6, 9].

function highScores = GetHighScores(gameScores, minScore)
% gameScores: Array contains all player scores
% minScore: Scores greater than minScore are added to highScores

meetsThreshold = (gameScores > minScore); % Logic array indicates which
% elements are greater than minScore

% Construct a row array highScores containing all player scores greater than minScore
highScores=0;

end;
Computers and Technology
1 answer:
Sever21 [200]2 years ago
8 0

Answer:

The solution is written using Python as it has a simple syntax.

  1. def getHighScores(gameScores, minScore):
  2.    meetsThreshold = []
  3.    for score in gameScores:
  4.        if(score > minScore):
  5.            meetsThreshold.append(score)
  6.    return meetsThreshold
  7. gameScores = [2, 5, 7, 6, 1, 9, 1]
  8. minScore = 5
  9. highScores = getHighScores(gameScores, minScore)
  10. print(highScores)

Explanation:

Line 1-8

  • Create a function and name it as <em>getHighScores</em> which accepts two values, <em>gameScores</em> and <em>minScore</em>. (Line 1)
  • Create an empty list/array and assign it to variable <em>meetsThreshold</em>. (Line 2)
  • Create a for loop to iterate through each of the score in the <em>gameScores</em> (Line 4)
  • Set a condition if the current score is bigger than the <em>minScore</em>, add the score into the <em>meetsThreshold</em> list (Line 5-6)
  • Return <em>meetsThreshold</em> list as the output

Line 11-12

  • create a random list of <em>gameScores</em> (Line 11)
  • Set the minimum score to 5 (Line 12)

Line 13-14

  • Call the function <em>getHighScores()</em> and pass the<em> gameScores</em> and <em>minScore </em>as the arguments. The codes within the function <em>getHighScores()</em>  will run and return the <em>meetsThreshold </em>list and assign it to <em>highScores.</em> (Line 13)
  • Display <em>highScores</em> using built-in function print().
You might be interested in
What is the correct order for the boot phases of a Linux computer?
galina1969 [7]

BIOS

Boot loader

OS Kernel

Init

6 0
3 years ago
What is one key difference between the radiation and convection zones?
Anuta_ua [19.1K]
 convection requires a medium is not the main difference, it is simply the most obvious aspect of what is a fundamentally different mechanism for transfering energy. Convection is the transfer of energy by movement of a medium, whereas radiation is the transfer of energy by, well, thermal radiation. Conduction also requires a medium, but, again, it is a fundamentally different mechanism than either convection or radiation; in this case it is the transfer of energy through a medium.

Unfortunately, analogies are hard but if you can visualize the particles involved, it would help. Picture the red hot iron you mentioned. On a molecular level, the material is emitting lots and lots of photons (hence why it is glowing red). The creation of these photons takes energy; energy from the heat of the iron. These photons leave the iron, pass through the environment, and eventually collide with some other object where they are absorbed and deposit their energy. This is radiative heat transfer. If that energy is deposited on your retina or a CCD (like in a digital camera), an image forms over time. This is how infrared goggles work and they would work equally well in high vacuum as here on earth.

In conduction, the next simplest example, there is no generation of photons (physics nerds forgive me for the sake of simplicity). The individual atoms in the object are vibrating with heat energy. As each atom gains energy from it's more energetic neighbors, so it gives up energy to its less energetic ones. Over time, the heat "travels" through the object.

In convection, the molecules of gas near the object gain energy, like in the conduction case, but those same molecules that gained energy then travel through the environment to some other location where they then give off their heat energy.

In summary:

radiation = generated and absorbed photonsconduction = molecules exciting their neighbors succesivelyconvection = molecules heated like in conduction, but then move to another location
7 0
3 years ago
Convert the decimal number -12 to hexadecimal (2's complement)
Helga [31]

Answer:

FFF4

Explanation:

Binary representation of 12 = 00001100

Expressing it in hexadecimal format : 0C

Binary representation of -12:

Step 1 : Computing 1's complement for 12 =11110011

Step 2 : Adding 1 to 1's complement to get the 2's complement =>

11110011+1 = 11110100

Converting the 2's complement representation to hexadecimal format:

F4 ( 8 bit representation) or FFF4 ( 16 bit representation)

4 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
Mrrafil [7]

Answer:

engineering

Explanation:

8 0
3 years ago
Read 2 more answers
Write a method swapArrayEnds() that swaps the first and last elements of its array parameter. Ex: sortArray = {10, 20, 30, 40} b
dybincka [34]

Answer:

The solution code is written in Java.

  1.    public static void swapArrayEnds(int myArray[]){
  2.        int lastIndex = myArray.length-1;
  3.        int temp = myArray[0];
  4.        myArray[0] = myArray[lastIndex];
  5.        myArray[lastIndex ] = temp;
  6.    }

Explanation:

First create the swapArrayEngs method that take one input array parameter (Line 1).

Since we need to swap the first and last element of the array, we need to get the first index and last index of the array. The first index is 0 and the last index can be calculated by subtracting the length of array from 1 (Line 2).

Next, we can create a temp variable to hold the value of the first element (Line 3). Then we use the lastIndex the get the value of last element and assign it to the first element of array (Line 4). Lastly, we assign the temp (holding the  initial first element value) to the last element of array (Line 5).

 

4 0
3 years ago
Read 2 more answers
Other questions:
  • . Network navigation devices, such as routers, help datatravel in bundles that are referred toas………..
    14·1 answer
  • Which type of system would be more reliable for keeping a plane traveling at constant speed – an automatically controlled feedba
    11·1 answer
  • Gunther is filling in his own input mask. He wants to format the Social Security numbers of his clients. The field must contain
    5·1 answer
  • How to see the range of values of vty lines?
    15·1 answer
  • You are having trouble closing a program. You have tried to hit the Close button, the keyboard shortcut to close the program, an
    6·1 answer
  • Write a program in which given an integer num, return the sum of the multiples of num between 1 and 100. For example, if num is
    7·1 answer
  • The costs incurred when a firm buys on the marketplace what it cannot make itself are referred to as
    6·1 answer
  • How can a cell phone tower help people​
    11·2 answers
  • After Daniel performed poorly on a test, his teacher advised him to do some self-reflection to figure out how he could get a bet
    13·1 answer
  • What are 3 customizations that can be done using the header/footer section in the customize reports tray?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!