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]
3 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]3 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
As Kaydence reads a chapter in her anthropology text, she draws a network diagramming the relationships among the concepts descr
german

Answer:

visual encoding

Explanation:

According to my research on the three types of encoding methods, I can say that based on the information provided within the question Kaydence is best described as capitalizing on visual encoding. Which is the act of associating a certain something with a picture in order to store it into memory, as opposed of associating it with sound or words. In this situation Kaydence is associating it with a networking diagram she drew.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
What is a space flight that doesn’t complete a full orbit referred to as?
Vikentia [17]

Answer:

A flight that does not reach space is still sometimes called suborbital, but is not a 'suborbital spaceflight'. Usually a rocket is used, but experimental sub-orbital spaceflight has also been achieved with a space gun.

Explanation:

3 0
3 years ago
Lindsay owns a candy store that typically makes all if its sales to tourists visiting a nearby zoo. Why might she decide to set
AVprozaik [17]
B and A. Both answers are correct
3 0
3 years ago
Read 2 more answers
Mark, a programmer, is testing his program in order to locate syntax errors. Which skill will help Mark most in detecting and re
Artist 52 [7]

Answer:

logic development

Explanation:

7 0
3 years ago
write a function interest() that takes one input, a floating-point interest rate (e.g., 0.06, which corresponds to a 6% interest
Novay_Z [31]

Code:

def interest():

   interest_rate = 0.06

   investment = input(int('Investment: '))

   yield = 0

   year = 0

   while (yield < investment):

       year += 1

       yield  = investment * interest_rate

   print (year)

NOTE: i wrote this code assuming that the investment for the next year is the same as the first year and so forth

8 0
3 years ago
Other questions:
  • Given non-negative integers x and n, x taken to the nth power can be defined as: x to the 0th power is 1 x to the nth power can
    7·1 answer
  • How much electricity is in the human brain? ​
    8·2 answers
  • A teacher takes the following steps when beginning to apply conditional formatting to a spreadsheet. Format Conditional Formatti
    8·1 answer
  • Mention<br>any<br>5<br>indicators of<br>happiness​
    11·2 answers
  • What is the command to create a compressed archive(archive1.tar.gz) of files test1 test2and test3.
    5·1 answer
  • Which of the following, (1) money deposited in a bank account, (2) student recording her answer to a question in an online test,
    9·1 answer
  • Is this statement true or false?
    11·1 answer
  • ___are designed to infect and cause damage to operating system files, computer registry, and other locations on the motherboard
    15·1 answer
  • What is the error in this?<br><br> userGuess = int(input(“Guess a number between 1 and 20: “))
    12·1 answer
  • Each JavaScript command line ends with a(n) ____ to separate it from the next command line in the program.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!