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
Bogdan [553]
2 years ago
13

Write a function findWithinThreshold that identifies the elements of a given array that are inside a threshold value. Takes the

following as input arguments/parameters : an integer array argSource that brings in the values that need to be examined. an integer that gives the size of the array argSource. an integer that gives the threshold value argThreshold. an integer array argTarget whose contents are to be filled by this function with elements from argSource that are less than argThreshold an integer argTargetCount that has been passed by reference to the function findWithinThreshold (this value needs to be filled by this function bas
Computers and Technology
1 answer:
tensa zangetsu [6.8K]2 years ago
8 0

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

/* Type your code for the function findWithinThreshold here. */

void findWithinThreshold(int argSource[], int argsSourseSize, int argThreshold, int argTarget[], int &argsTargetSize)

{

argsTargetSize = 0;

for (int i = 0; i < argsSourseSize; i++)

{

if (argSource[i] <= argThreshold)

argTarget[argsTargetSize++] = argSource[i];

}

}

/* Type your code for the function findWithinLimits here. */

void findWithinLimits(int argSource[], int argsSourseSize, int argLowLimit, int argHighLimit,int argTarget[],int &argTargetCount)

{

argTargetCount = 0;

for (int i = 0; i < argsSourseSize; i++)

{

if (argSource[i]>=argLowLimit && argSource[i] <= argHighLimit)

argTarget[argTargetCount++] = argSource[i];

}

}

int main() {

const int MAX_SIZE = 100;

int source[MAX_SIZE]; //integer array source can have MAX_SIZE elements inside it ;

// user may chose to use only a portion of it

// ask the user how many elements are going to be in source array and

// then run a loop to get that many elements and store inside the array source

int n;

cout << "How many elements: ";

cin >> n;

for (int i = 0; i < n; i++)

{

cout << "Enter " << (i + 1) << " element: ";

cin >> source[i];

}

int threshold, lower_limit, upper_limit;

/* Type your code to declare space for other required data like

target array (think how big it should be)

threshold

lower limit

upper limits

as well as the variable that will bring back the info regarding how many elements might be in target array

*/

int *target = new int[n];

int targetCount;

cout << "\nEnter thresold value: ";

cin >> threshold;

/* Type your code to get appropriate inputs from the user */

cout << "\nEnter lower limit: ";

cin >> lower_limit;

cout << "\nEnter upper limit: ";

cin >> upper_limit;

/* Type your code here to call/invoke the function findWithinThreshold here.. */

/* Type your code to print the info in target array - use a loop and think about how many elements will be there to print */

findWithinThreshold(source, n, threshold, target, targetCount);

cout << "\nElement in the threshold = " << targetCount << endl;

for (int i = 0; i < targetCount; i++)

cout << target[i] << "\n";

/* Type your code here to call/invoke the function findWithinLimits here.. */

/* Type your code to print the info in target array - use a loop and think about how many elements will be there to print */

findWithinLimits(source, n, lower_limit, upper_limit, target, targetCount);

cout << "\n\nElements with in the " << lower_limit << " and "<<upper_limit<<endl;

for (int i = 0; i < targetCount; i++)

cout << target[i] << " ";

cout << endl;

system("pause");

return 0;

}

You might be interested in
A tracking signal A. is computed as the mean absolute deviation​ (MAD) divided by the running sum of the forecast errors​ (RSFE)
ladessa [460]

Answer: B.

​

Explanation:

8 0
2 years ago
"what type of index has an index key value that points to a data row, which contains the key value? "
Ira Lisetskai [31]
The nonclustered index is a <span>type of index that has an index key value that points to a data row, which contains the key value.
</span><span>This index has a structure separate from the data rows and contains index key values and each key value entry has a pointer to the data row that contains the key value.
</span><span>Clustered indexes on the other hand sort and store the data rows in the table or view based on their key values.</span>
8 0
3 years ago
Answer this question for points lol
Zanzabum

Explanation:

jxjxnxnxnxkxozj nxkakthanksssssss lolll

8 0
2 years ago
Read 2 more answers
What are rules that enforce basic and fundamental information-based constraints?
irga5000 [103]
The
answer should be C.
8 0
2 years ago
Please solve in 5 mins very fast​
Dmitriy789 [7]

Answer:

a. virtual reality

b. Master Boot Records

c. Primary function of a router

d. zoom

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • The section called Breaking Substitution Ciphers (p. 166) describes a "random substitution cipher," in which each letter of the
    11·1 answer
  • What can be done to improve the security of business uses of the Internet? Give several examples of ecurity measures and technol
    9·1 answer
  • When evaluating portable CD players, you consider price, the sound quality, and ease of using the controls. These are your _____
    8·2 answers
  • Using a caesar cypher with an offset of three characters (a -&gt; d, b -&gt;e, ...., z -&gt; c), what would be the correct cyphe
    6·1 answer
  • What steps might a company or organization need take in order to keep its digital data secure online?
    8·1 answer
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    6·1 answer
  • Which four of the following qualify as fair use?
    11·2 answers
  • Write a method that accepts an integer argument and returns the sum of all the integers from 1 up to (and including) the number
    14·1 answer
  • Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know th
    10·1 answer
  • Which of the following was the first computer-animated film to win animated film to win an academy award?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!