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
Prime numbers can be generated by an algorithm known as the Sieve of Eratosthenes. The algorithm for this procedure is presented
Sidana [21]

Answer:

const MAXNR=150;

let candidates = {};

for(let i=2; i<=MAXNR; i++) {

   candidates[i] = true;

}

for(let p=2; p <= MAXNR; p++) {

   if (candidates[p]) {

       process.stdout.write(`${p} `);

       // Now flag all multiples of p as false

       i=2;

       while(p*i <= MAXNR) {

           candidates[p*i] = false;

           i++;

       }

   }

}

4 0
3 years ago
The key to security policy is being able to measure compliance against a set of controls. Security controls define _____ ______
Virty [35]

Answer:

The correct words for the blank spaces are: how; why.

Explanation:

In computer science, security control implies all the efforts of how organizations prevent, detect, and attack risks to safeguard sensitive information. Security policies establish why those actions are taken and set a list of all the assets that must be protected in front of a breach.

8 0
4 years ago
Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
OverLord2011 [107]

I would honestly say that there are a few available tools that Carrie can use, but the best tool is the inbuilt Windows Powershell. As Powershell continues to extend its purpose and usefulness, Microsoft, on the other hand, continues to use Powershell's capability to develop more cmdlets for products like Windows Servers. Everything that can be done in a GUI environment can be done in Powershell. Carrie should be able to use Powershell to run things more efficiently from the command line without stepping a foot on the physical server. She will only need to access the server from her desk remotely, run a few commands, and that is it. Powershell command line is so powerful; it carries with it every troubleshooting pack that you can think about.

5 0
3 years ago
Illl give brainliest plzzzzzzzzzz
salantis [7]

The one paste symbol name is : paste settings

it consist of 'paste special' and 'set default paste if im not wrong'

3 0
3 years ago
NEED HELP NOW 25 POINTS WILL MARK BRAINLIEST!!!!!!!
Rudiy27
#1, Option D)filters let you filter out certain things or search for them. For example if i'm looking through a database with all the students grades. I could filter out everything that doesnt math a students name. This would only show results for what I searched for.
#2 Option C), filters make it easier to find specific information,
#3 Option A),the unwanted parts of the web are removed from sight!
#4 Option A) you must ad the sort feature first!
Have a splendid day!
6 0
3 years ago
Other questions:
  • Explain a business scenario where management information systems plays a part.
    11·1 answer
  • The stack ADT may be implemented with
    13·1 answer
  • write code to declare variables for s0 with a value of 12.0, v0 with a value of 3.5, a with a value of 9.8, and t with a value o
    13·1 answer
  • Create an application that writes a series of random numbers to a file. Each random number should be in the range of 1 through 1
    9·1 answer
  • The four general functions of any application program are: data storage, data access logic, application logic and presentation l
    11·1 answer
  • Identify the final stage of the object found in the image in the given text
    9·1 answer
  • Write a python program to find factorial, use exception handling and display an appropriate message if the user inputs alphabets
    7·1 answer
  • i emailed someone and im sure that they emailed back however it says nothing has arrived in my inbox what do I do
    6·1 answer
  • WILL GIVE BRAINLIEST!!! PLEASE HELP!!!
    5·1 answer
  • Enter a formula in cell C13 to look up the registration fee for the first vehicle. Use the vehicle type in cell C4 as the Lookup
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!