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
Write a single instruction that inverts bits 5 and 6 in the bl register
katrin [286]

The single instruction that can inverts bits 5 and 6 in the bl register is xor bl,1100000b.

<h3>What is single instruction?</h3>

Single Instruction is a term that connote all the data streams are said to be processed though the use of the same compute logic.

Note that in the case above, the single instruction that can inverts bits 5 and 6 in the bl register is xor bl,1100000b.

Learn more about bits from

brainly.com/question/19667078

#SPJ12

5 0
2 years ago
Ron was asked to maintain a database to record the height of every student in class.
Fiesta28 [93]

B. =Compare(B3;B4)

hope I helped!!!

4 0
3 years ago
Read 2 more answers
The space between letters in a word is an example of what kind of space?
777dan777 [17]

Answer:

Explanation:

While the words are positive space, you have two kinds of negative space in text passage. Micro-space refers to the small spaces between letters and words. Macro-space, however, refers to the spaces between the big or major elements in a design, like the space between lines and columns of text.

4 0
2 years ago
Read 2 more answers
To figure out how to use her MacBook Pro graphics software to update designs originally created on a DEC10, Marianne needs to us
mina [271]

Answer:

Glue Language

Explanation:

I'm not 100% sure, but here is the definition.

Glue language- A programming language that can be used to provide interoperability between systems not originally intended to work together

6 0
3 years ago
Why is it important to understand the basic ways in which pictures and video are stored in the computer?
nalin [4]

Answer:

This is important to understand the basic ways to store pictures and video in a computer because both of them consume a relatively large storage spaces in a the computer compared with normal text files.

Explanation:

Nowadays, many computers shipped with a SSD drive (Solid State Drive) with only around 256 - 512 Gb. With this capacity, the storage spaces left to store the pictures and video are very limited after installation of the essential software.

One common way to store pictures and video is to save them at an external hard drive. Another option is the cloud storage service such as Google Drive, Google Photo etc. These storage mediums obviate the need to store those media files into the local computer machine.

6 0
3 years ago
Other questions:
  • . What may happen if a large number of computer users are attempting to access a Web site at the same
    10·2 answers
  • The ListIterator interface
    13·1 answer
  • What languages other than English are spoken in the United States?
    14·1 answer
  • The speed of sound depends on the material the sound is passing through. Below is the approximate speed of sound (in feet per se
    9·1 answer
  • 10 points!
    12·1 answer
  • A browser is an example of a. :
    7·1 answer
  • This function chooses the screen to display based on the score.What is the correct way to call this function?
    13·2 answers
  • What Is the device used to produce hard copies from personal computer ​
    5·2 answers
  • Similarities between master file and reference file
    12·1 answer
  • What is the first step you should take if unable to make bill payments on time?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!