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]
3 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]3 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
Ning wants to gather data about humidity for a science project. Which of these are needed to gather data?
IgorLugansk [536]

Answer:

A -  information

Explanation:

in the question it says Ning wants to GATHER DATA for the project so, he need information.

IF im wrong, plz tell me and sry if i am

8 0
3 years ago
Read 2 more answers
What are some particular game ideas for a Roblox developer. *Ideas that weren't copied or done before (simulators, tycoons, you
Helga [31]

Hi! I've also been playing Roblox since 2009, and I know the struggle of wanting to create an "original" game that hasn't been made before on Roblox.

As a member of RAT and a fan of Polymorphic's games in that group, I just wanna say that the games you were a part of (and others, I'm sure) are amazing.

As for original games, that's unfortunately pretty difficult because Roblox Studio and the Roblox platform has some limitations as to what games you can create. However, I can still offer some ideas that I've always wanted to make, but couldn't because of my lack of scripting/building ability.

I used to be a huge fan of Pokemon, and games like Pokemon Arena X on Roblox. I've always wanted to make a game based off Pokemon, except instead of being limited to using 6 Pokemon at a time, I'd want to be able to build an army. For example, I want to be able to fight other trainers by commanding and summoning my various groups of Pokemon while flying on my Dragonite. Or having a separate cutscene when you encounter another trainer that looks something like Warlords 2: Rise of Demons (search this up on Google and you'll be able to see the format I'm talking about for a fight scene). If not a Pokemon conquest, maybe just another Pokemon minigame; those were always popular but ended up being deleted for reasons I'm not 100% sure of.

I've also always loved action games. What about making a game where you kill other Robloxians, but in order to do so, you have to possess NPCs within the game? You're a spirit with no power except the a starterpack of a few weapons and the ability to take over NPC bodies or characters, ranging from a snail that is extremely slow to someone who owns a gun or tank or whatever. I've never really thought about the details, but you can only possess a character for a certain amount of time before they realize they're being possessed and expel you. Then to switch "bodies", you have to spin a wheel or something and you can integrate game passes to improve probability.

These are just some ideas that you definitely don't even need to consider, and may not even be possible to integrate on Roblox's platform. But feel free to respond with your feedback or even add me on Roblox if you want to collaborate more. Just respond with your wishes and I'll get back to you when I come onto Brainly again.

Hope I was able to help :)

4 0
3 years ago
Read 2 more answers
Effective data communication relies on many components to function collaboratively and reliably. When troubleshooting network pr
enyata [817]

The likely issue cause of the problem in the scenario.

  • Modem: Problem: Dante's home router reports that it's not connected to the internet.

<h3>What is the reason for the above scenario?</h3>

The reason for the modem problem may be due to  some issue that occurs with the connection of the modem device

Therefore, The likely issue cause of the problem in the scenario.

  • Modem: Problem: Dante's home router reports that it's not connected to the internet.  because it is only with the modem that he can connect to the internet and thus need to solve the issue.

Learn more about  communication from

brainly.com/question/26152499

#SPJ1

3 0
2 years ago
Something is wrong with the logic in the program above. For which values of time will the greeting "Good Morning!" be displayed?
Klio2033 [76]

Answer:

There is logic problem in condition of elseif statement that is (time<20).

Explanation:

elseif(time<20) will be true for time<10 that means program will never greet good morning as to make logic correct either change condition from <em>elseif(time<20)</em> to <em>elseif(time<20&& time>=10)</em>. Or change the order of condition like check first for <em>elseif(time<10) </em>

solution 1

if (time < 6) { greeting = "It is too early!"; }

else if (time < 20 && time>=10) { greeting = "Good Day!"; }

else if (time < 10) { greeting = "Good Morning!"; }

else { greeting = "Good Evening!"; }

console.log(greeting);

solution 2

if (time < 6) { greeting = "It is too early!"; }

else if (time < 10) { greeting = "Good Morning!"; }

else if (time < 20 ) { greeting = "Good Day!"; }

else { greeting = "Good Evening!"; }

console.log(greeting);

7 0
3 years ago
What is the output?
yuradex [85]

Answer:

this is x,y correct?

well if it is then wouldnt it be 5,30?

8 0
3 years ago
Other questions:
  • What type of gloves protects your hands from hazardous chemicals?
    11·2 answers
  • Provides information of the active slide at the bottom of the slide
    5·1 answer
  • Allows an administrator to query a dns database and find the host name associated with a specific ip address or
    15·1 answer
  • Guys i really need help pleasure?
    7·2 answers
  • A customer survey asked respondents to indicate their highest levels of education. The only three choices in the survey were hig
    15·1 answer
  • Which of the following is the answer?
    5·1 answer
  • Time-management techniques work most effectively when performed in which order?
    7·1 answer
  • Which of the following is NOT a function of a Web Browser?
    9·1 answer
  • What does altgr mean on a keyboard.
    10·1 answer
  • _____ refers to the programs that a device can run.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!