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
mart [117]
3 years ago
15

Write your code to define and use two functions. The Get User Values function reads in num Values integers from the input and as

signs to user Values. The Output Ints Less Than Or Equal To Threshold function outputs all integers in user Values that are less than or equal to maxVal. num Values indicates the number of integers in user Values. void Get User Values(int user Values[], int num Values) void Output Ints Less Than Or Equal To Threshold (int user Values[], int maxVal, int num Values)
Computers and Technology
1 answer:
ZanzabumX [31]3 years ago
6 0

Answer:

#include <iostream>

#include <vector>

using namespace std;

/* Define your function here */

vector<int> GetUserValues(vector<int>& userValues, int numValues) {

  int tmp = 0;

  vector<int> newVec;

 

  for(int i = 0; i < numValues; i++) {

     cin >> tmp;

     newVec.push_back(tmp);

     

  }

 

  return newVec;

}

void OutputIntsLessThanOrEqualToThreshold(vector<int> userValues, int upperThreshold) {

  for (int i = 0; i < userValues.size(); ++i) {

     if(userValues.at(i) < upperThreshold) {

          cout << userValues.at(i) << " ";

     }

  }

 

  cout << endl;

}

int main() {

  vector<int> userValues;

  int upperThreshold;

  int numValues;

 

  cin >> numValues;

  userValues = GetUserValues(userValues, numValues);

  cin >> upperThreshold;

  OutputIntsLessThanOrEqualToThreshold(userValues, upperThreshold);

  return 0;

}

Explanation:

Perhaps their is a better way to code this, but I couldn't figure out what to do with the pointer in the first function.

You might be interested in
____ technology essentially takes the data to be transmitted and rather than transmitting it in a fixed bandwidth spreads it ove
aleksley [76]

Answer: Spread spectrum

Explanation:

In spread spectrum the data to be transmitted is spread over a wider bandwidth rather than fixed bandwidth.

4 0
4 years ago
Select the correct answer,
bazaltina [42]

Answer:

b gyhffhhhgghhhhhhhhhhh

3 0
4 years ago
Cuantos actos ay en el mito de aracne
mash [69]

Answer:

En el mito de Aracne hay un acto, que se desarrolla con cinco escenas.

Explanation:

En el mito de Aracne hay un solo acto, que se desarrolla con cinco escenas. En este mito, la joven Aracne es muy hábil tejiendo, tanto así se enorgullece de su talento que se compara y se considera mejor que la diosa Atenea. Esto último ofende a la divinidad, que le advierte sobre su egocentrismo, lo que lleva a que ambas mujeres participen en una competencia. Aracne demuestra ser muy hábil pero irrespetuosa, lo que hace enfadar a la diosa. Al final, la joven se da cuenta de su error y se ahorca, pero Atenea se apiada de ella y la transforma en una araña.

6 0
4 years ago
What is the definition of a unit test from a devops perspective?.
igomit [66]

Answer:

khhghgl

Explanation:

8 0
3 years ago
Ten(10) examples of wearables or wearable technologies?​
Semmy [17]

Answer:read

Explanation:

airpods

headphones

earbuds

AirPods  pro

watch

fitbit (type of watch that counts your miles) &you can say workout watch&

VR set

technology bracelet

smart glasses

Smart ring

7 0
3 years ago
Other questions:
  • How far from the bullet is text indented
    6·2 answers
  • Question 12 :A user complains that his computer is taking a long time to boot. During the boot process, you observe that the har
    7·1 answer
  • Which is an example of Raw Input?
    11·1 answer
  • 2. Write a standalone function partyVolume() that takes accepts one argument, a string containing the name of a file. The object
    14·1 answer
  • Edhesive 4.6 lesson practice <br><br> Range is an example of a_______.
    10·2 answers
  • How much do high-end earners make as power plant operators? Type answer as numerical number.
    14·1 answer
  • 1.) Explain one way the internet has impacted the way we behave.
    7·2 answers
  • 8.4 Lesson Practice <br> edhesive quiz
    12·1 answer
  • In your own words, how are sources of income and expenses related to
    12·2 answers
  • List and describe with details at least three approaches to selecting processes from priority-based multi-level queues.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!