answer.
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
"There are no longer mature industries; rather, there are mature ways of doing business," he is referring to the high demand of
yanalaym [24]

Hi, you've asked an incomplete and unclear question. However, I provided the full text below.

Explanation:

The text reads;

<em>"When Porter says “There are no longer mature industries; rather, there are mature ways of doing business,” he is referring to the high demand for creativity and innovation in the market. Earlier we used to be more concerned about the hardware and the physical product rather than its information content, But now as a business, we need to provide more informative content with the product.</em>

<em>Like General Electric offers dedicated customer service for its line of goods which differentiates it from its rivals. Similarly, shipping companies like UPS now offer us to track the location of our package on a live map. This is what we call a mature business and how we can differentiate ourselves and stand out in the highly competitive market by using Information and Technology..."</em>

4 0
2 years ago
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year
Dafna11 [192]

What is the expected total cost for one year at the local community college if Kirk lives at home?

Answer: $6845



What is the expected total cost for one year at the out-of-state school if Kirk lives on campus?

Answer: $30,566

5 0
2 years ago
Read 2 more answers
ArgumentException is an existing class that derives from Exception; you use it when one or more of a method’s arguments do not f
dybincka [34]

Answer:

The C# code is given below

Explanation:

using System;

public class SwimmingWaterTemperatur

{

public static void Main()

{

while(true){

Console.Write("\nPlease enter the water temperature : ");

int x = Int32.Parse (Console.ReadLine());

try{

if(CheckComfort(x)){

Console.Write(x+" degrees is comfortable for swimming.");

}else{

Console.Write(x+" degrees is not comfortable for swimming.");

}

}catch(Exception ex){

Console.WriteLine(ex);

}

}

}

public static Boolean CheckComfort(int temp){

if(temp>=70 && temp<=85){

return true;

}else if(temp>=32 && temp<=212){

return false;

}else{

throw new ArgumentException("Value does not fall within the exptected range.");

}

}

}

7 0
2 years ago
A time-saving strategy that helps define unfamiliar words involves using
yuradex [85]

The correct answer is A. Familiar words for clues

Explanation:

Finding unfamiliar words is common while reading, especially in texts that belong to a specific field such as medicine, technology, etc. This can be handled through multiple strategies such as using a dictionary, guessing the meaning of the word based on its parts, and using context clues.

In this context, one of the easiest and most time-saving strategy is the use of context clues that implies using the familiar words as clues to guess the meaning of an unfamiliar word. This is effective because in most cases the meaning of an unknown word can be determined using the context of the word or words around the unknown word. Also, this strategy takes little time because you only need to analyze the sentence or paragraph where the unknown word is. Thus, the time-saving strategy to define unfamiliar words involves using familiar words for clues.

6 0
2 years ago
Read 2 more answers
Square a Number This is a practice programming challenge. Use this screen to explore the programming interface and try the simpl
yan [13]

Answer:

import java.io.*;

public class Main {

  public static void main(String[] args) throws IOException {

      BufferedReader brObject = new BufferedReader(new InputStreamReader(System.in));

      String str;

      while ((str = brObject.readLine()) != null) {

          int number = Integer.parseInt(str);

          System.out.println(number * number);

      }

  }

}

Explanation:

  • Inside the main method, create an object of BufferedReader class to read lines from standard input.
  • Declare a string and run a while loop until it reaches the end of the input.
  • Inside the while loop convert the string into an integer data type.
  • Finally display the output by squaring the number.
3 0
2 years ago
Other questions:
  • Graphical elements that precede each item in a list are known as​ __________.
    8·1 answer
  • Letitia is in high school. She wants to go to medical school in Kentucky and then become a pediatric surgeon to help children. W
    5·2 answers
  • It is an array containing information such as headers, paths and script locations wherein it is created by the web server itself
    8·1 answer
  • Design two subclasses of Employee…SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An ho
    12·1 answer
  • Create an abstract Division class with fields for a company's division name and account number, and an abstract display() method
    14·1 answer
  • Write a C program that creates two threads to run the Fibonacci and the Runner processes. Threads will indicate the start and th
    14·1 answer
  • Programmers often author which type of information to guide test runs?
    10·1 answer
  • Write a function in the cell below that iterates through the words in file_contents, removes punctuation, and counts the frequen
    6·1 answer
  • You work for a car rental agency and want to determine what characteristics are shared among your most loyal customers. To do th
    10·1 answer
  • Which XP practice prescribes that "the code [always be] written by two programmers at one machine"?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!