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
When 2 or more computers are connected it is called?
Alenkasestr [34]

When two or more computers are connected it is called Local Area Network (LAN).

5 0
2 years ago
Which of the following uses replication to Infect multiple computers?
Nikolay [14]

Answer:

Trojan horse

Explanation:

mostly all the above mentioned use replication to infect computers but the one that uses replication to invest multiple computers at a time is Trojan horse.

hope it helps .

3 0
2 years ago
Read 2 more answers
A ________ power station uses the energy from a small piece of metal called Uranium ​
grigory [225]

Answer:

nuclear power plant

Explanation:

A nuclear reactor, or power plant, is a series of machines that can control nuclear fission to produce electricity. The fuel that nuclear reactors use to produce nuclear fission is pellets of the element uranium. In a nuclear reactor, atoms of uranium are forced to break apart.

3 0
3 years ago
Read 2 more answers
Brainless is one the way if you help
V125BC [204]

Answer:

1. x - 6

2. p - ? = 7

i chose these equations because

a number - 6 = the weight of your backpack.

p - an unknown number without a substitute variable = slices of bread left.

3 0
2 years ago
Write an If...Then statement that assigns 0 to intX when intY is equal to 20
BigorU [14]

Answer:

wh,,what?

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • Once your hard drive is installed what needs to be done to the drive and what do these two tasks do
    12·1 answer
  • To easily add an organizational chart to a document, users should select _____. SmartArt Text Boxes Shapes Clip Art
    8·2 answers
  • What three conditions must be satisfied in order to solve the critical section problem?
    13·1 answer
  • What is the purpose of system calls, and how do system calls relate to the OS and to the concept of dual-mode (kernel-mode and u
    14·1 answer
  • Componets of computer
    5·1 answer
  • To expand a window to the full size of the screen.​
    6·2 answers
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • What are the side effects of overclocking?
    13·1 answer
  • Do earthquakes ever happen in Malaysia?​
    8·1 answer
  • Which kind of image is indispensable and needs added text to go with ?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!