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]
2 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]2 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
An organization is looking to add a layer of security by implementing a solution that protects hosts against known and unknown m
klio [65]

Answer: D) Whitelisting

Explanation:

Whitelisting are used in many applications and it only allows the good known apps. Whitelisting are majorly used for security purpose as, it permits to maintain or control the misuse the apps by employees in an organisation.

Blacklisting maintain the list of denied access system and it prevented the accessing undesirable program. It is also used as security application but it is less effective than whitelisting.

Encryption are the process which are not used in the restricting application. And lockout are used by the users for entering the password for many time as possible.  

Therefore, option (A) is correct.

4 0
3 years ago
Write a complete program that declares an integer variable, reads a value from the keyboard into that variable, and writes to st
vovikov84 [41]

Answer:

#include <iostream>

using namespace std;

int main ()

{

int num;

cin>>num;

cout << num<< " " << 2 num << " " << numnum;

return 0;

}

Explanation:

See answer

5 0
3 years ago
One benefit of open source software is that it
kherson [118]

Answer:

allows access to the source code

Explanation:

this means you can edit and customize it however you wish

an example of one is AnkiDroid

6 0
2 years ago
When should students practice netiquette in an online course? Check all that apply.
mixas84 [53]

Answer:

when sending emails to classmates

when participating in online discussion boards

when collaborating as part of digital team

Explanation:

i just took the test

5 0
3 years ago
A benefit of flashcards is that they are
Natalka [10]
Flashcards are re-writable so they can be used over and over again. they also have very large capacity to hold a lot of things.
6 0
2 years ago
Read 2 more answers
Other questions:
  • What are the uses of a modem
    5·1 answer
  • Declare a structure whose tag name is Server and that contains the following fields: manufacturer, a string, model and serialnum
    9·1 answer
  • To quit Word, click the Restore button on the right side of the title bar. <br> True <br> False
    6·1 answer
  • The list below represents the contents of a computer's main memory. I've left every other byte blank. Assume that the letters at
    14·1 answer
  • Increasing your margins will increase the amount of space you have to type text on your document. Please select the best answer
    10·1 answer
  • A. Write a program that asks the user to enter an integer, then prints a list of all positive integers that divide that number e
    11·1 answer
  • What property of semi-metals is useful in the computer industry?
    7·1 answer
  • Write all the hexadecimal numbers in sequence from 9F7H to A03H
    9·1 answer
  • Brainly, ""helping you get better grades"
    6·2 answers
  • A location in memory which stores a value, the value can change as the program is running is
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!