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
Sidana [21]
3 years ago
9

Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer

s that follow. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a space, even the last one. The output ends with a newline.
Ex: If the input is: 5 25 51 0 200 33
0 50

then the output is:
25 0 33
Computers and Technology
1 answer:
snow_tiger [21]3 years ago
3 0

Answer:

The program implemented in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

int lenlist;

vector<int> mylist;

cout<<"Length List: ";

cin>>lenlist;

mylist.push_back(lenlist);

int i =0; int num;

while(i<lenlist){

   cin>>num;

   mylist.push_back(num);  

   i++;

}

int min,max;

cout<<"Min: ";  cin>>min;

cout<<"Max: ";  cin>>max;

cout<<"Output!"<<endl;

for(int i=1; i < mylist.size(); i++){

  if(mylist.at(i)>=min && mylist.at(i)<=max){

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

  }

}

  return 0;

}

Explanation:

This declares the length of the list as integer

int lenlist;

This declares an integer vector

vector<int> mylist;

This prompts user for length of the list

cout<<"Length List: ";

This gets input of length of the list from the user

cin>>lenlist;

This pushes user input to the vector

mylist.push_back(lenlist);

int i =0; int num;

The following iteration gets user inputs and pushes them into the vector

<em>while(i<lenlist){ </em>

<em>    cin>>num; </em>

<em>    mylist.push_back(num);  </em>

<em>    i++; </em>

<em>} </em>

This declares min and max variables

int min,max;

This prompts user for the lower bound

cout<<"Min: ";  cin>>min;

This prompts user for the upper bound

cout<<"Max: ";  cin>>max;

The following iteration checks for numbers within the lower and upper bound and print the numbers in that range

<em>cout<<"Output!"<<endl; </em>

<em>for(int i=1; i < mylist.size(); i++){ </em>

<em>   if(mylist.at(i)>=min && mylist.at(i)<=max){ </em>

<em>       cout<<mylist.at(i)<<" "; </em>

<em>   } </em>

<em>} </em>

You might be interested in
PART 2 - Exercise 2 - Programming Assignment
Oliga [24]

Suppose that a linked list is used as a data structure for the hash table, create a program that includes steps his application counts the number of phrases in documents decided on via way of means of the user #include.

<h3>What is Programming?</h3>

It is the manner of making hard and fast commands that inform a pc the way to carry out a task. Programming may be finished the usage of lots of pc programming languages, inclusive of JavaScript, Python, and C++.

  1. This application counts the quantity of phrases in documents decided on via way of means of the user.
  2. #include
  3. #include
  4. #include the usage of namespace std; //Function 1 int count(string word)go back word.size();
  5. }
  6. //Function 2
  7. int vowel(string word)> filename;
  8. //Open the {input|enter">enter file.
  9. inputfile.open(filename.c_str()); cout<<"nWord listing after format";
  10. cout<<"n____nn"; //If the file succesfully opened, process it.if (inputfile).

Read more about program :

brainly.com/question/1538272

#SPJ1

5 0
2 years ago
Question 1
PolarNik [594]

Answer:

she is running a maintenance to make sure everything works

6 0
3 years ago
Kevin is working on a financial project that involves a lot of statistical information. He needs software that allows him to ent
makvit [3.9K]

Answer: Spreadsheet Software

If Kevin would use a spreadsheet software, he will be able to input all of the statistical data and have the software generate graphs of the data that he has inputted into the spreadsheet. Using a spreadsheet software, Kevin will also have access to changing the graphs data whenever an anomaly has been detected.

Some of examples of these software would be:

  • Microsoft Excel
  • Open Office
  • Google Sheets
  • LibreOffice

8 0
3 years ago
Groupthink refers toA) the willingness of individual group members to withhold contrary or unpopular opinions, even when those o
Ivan

Answer:

The correct answer is A.

Explanation:

Groupthink is a theory that is applied to decision making psychology in groups, developed by Irving Janis. The theory roots itself to the problem of conformity especially in group settings. When a decision is made in a group, some members, even though they believe that the decision made is wrong or can be better, get caught up in the conformity problem and follow the accepted solution to allign with the group's decision.

I hope this answer helps.

5 0
3 years ago
Suppose the following sequence of bits arrives over a link:
Lera25 [3.4K]

Answer:

ok

Explanation:

4 0
3 years ago
Other questions:
  • Which part of color theory deals with how colors on a web page relate to each other?
    11·2 answers
  • What products use fabric manipulation
    8·1 answer
  • What are some of the challenges that could arise from setting up a file management system on a computer?
    8·1 answer
  • Sam wants to move from his current role in his organization to a managerial role. Which certification will help him get on a man
    6·1 answer
  • Nine and 2 hundred thirty-five thousandths has a decimal
    5·2 answers
  • Tablets combine the features of which two types of devices?
    10·2 answers
  • Betty removed a web page from her website. Some users were browsing on her website. One of them clicked on a particular link and
    15·1 answer
  • Which of the following provides services to hosts on its network?
    9·1 answer
  • What is a computer modem?​
    9·1 answer
  • Two negative reviews and no positive reviews is enough to consider the website to have a negative reputation.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!