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
What do application in productivity suites have in common
Alchen [17]

Answer:

The function of the suites application is to create presentations and perform numerical calculations.

Explanation:

6 0
3 years ago
Question # 1 Multiple Select Which of the following shows the assignment of a string to a variable? Select 3 options. answer = "
bazaltina [42]

Answer:

answer = input("How old are you?")

Explanation:

Answer is a variable The Input function takes a string

6 0
3 years ago
Read 2 more answers
Your customer, Mykel, is ordering a custom-built computer for his home office and isn’t sure which components should be the high
charle [14.2K]

Answer:

b. High-end CPU, lots of RAM, and high-end graphics card

Explanation:

Based on the information provided within the question it can be said that the priorities that would best benefit Mykel would be first high-end cpu, ram,  and then high-end graphics card. This is because the cpu and ram will allow Mykel to speed up his processing speeds which will allow for a smoother time when running multiple VM's while developing software. Then the high end graphics card will allow him to play the nest and most graphical intense games out there.

4 0
3 years ago
The goal of this project is to become familiar with basic Python data processing and file usage. By the end of this project, stu
xenn [34]

Answer:

Explanation:

The question does not provide any actual data to manipulate or use as input/guidline therefore I have taken the liberty of creating a function for each of the question's points that does what is requested. Each of the functions takes in a list of the needed data such as a list of field test averages for part 1, or a list of field tests for part 2, etc. Finally, returning the requested output back to the user.

import matplotlib.pyplot as plt

from collections import Counter

def best_pilot(field_test_average):

   return max(field_test_average)

def find_average(field_test):

   average = sum(field_test) / len(field_test)

   return average

def create_histogram(field_test_colors):

   count_unique_elements = Counter(field_test_colors).keys()

   plt.hist(field_test_colors, bins=len(count_unique_elements))

   plt.show()

def average_name_lengths(first, last):

   first_name_sum = 0

   last_name_sum = 0

   count = 0

   for name in first:

       first_name_sum += len(name)

       count += 1

   for name in last:

       last_name_sum += len(name)

   first_name_average = first_name_sum / count

   last_name_average = last_name_sum / count

   return first_name_average, last_name_average

7 0
2 years ago
How do we make a acount
IRISSAK [1]
Press sign up and put your information in there. Then it should automatically make your profile.
8 0
3 years ago
Read 2 more answers
Other questions:
  • When introducing new devices to the network, the organization's security policy requires that devices be monitored to establish
    15·1 answer
  • Technology has proliferated in Kenya and Somaliland, with text messages used to replace cash, creating mobile money use that, on
    11·1 answer
  • What computer is designed to meet the computing needs of several people simultaneously in a small to medium-size business enviro
    5·1 answer
  • Write an if statement that prints the message ""The number is not valid"" if the variable distance is outside the range 100 thr
    8·1 answer
  • What are the differences between tkinter toolkit and PyQt?
    14·1 answer
  • Directions: Arrange the jumbled letters to make/form a new word. Then give a
    12·1 answer
  • What statement best describes entrepreneurship?
    7·2 answers
  • What would a system unit that is integrated with the display and keyboard would be considered?
    6·1 answer
  • State the base of correct addition of 27 + 6 =34​
    13·1 answer
  • ____ the most popular word processing applications software<br><br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!