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]
2 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]2 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
How Do you get Splatoon two for free
IRISSAK [1]

Answer:

Well the real question would be how comfortable are you with computer software if not good or none at all I feel the answer would simply be buy the game in the Nintendo store or you could buy the key for the Nintendo store for much cheaper on 3rd party websites give that a try hope this helped you. :)

5 0
2 years ago
Read 2 more answers
// This pseudocode is intended to describe
ddd [48]

Applying given information of a computational language in pseudocode, a code may be written to represent computing the price of an item on sale for 10% off.

<h3>What is a pseudocode?</h3>

A pseudocode can be considered as a depiction of the steps represented in an algorithm, usually in plain (natural) language.

<em>//This </em><em>pseudocode </em><em>is intended to describe</em>

<em>//computing the </em><em>price </em><em>of an </em><em>item </em><em>on </em><em>sale </em><em>for 10% off</em>

<em>START</em>

<em>  input origPrice</em>

<em>  </em><em>discount </em><em>= origPrice * 0.10</em>

<em>  </em><em>finalPrice </em><em>= origPrice - discount</em>

<em>  output finalPrice</em>

<em>STOP</em>

<em>//This pseudocode is intended to </em><em>compute </em><em>the number</em>

<em>//of miles per </em><em>gallon </em><em>you get with your car.</em>

<em>START</em>

<em>  input milesTraveled</em>

<em>  input gallonsOfGasUsed</em>

<em>  milesPerGallon = milesTraveled / gallonsOfGasUsed</em>

<em>     //milesPerGallon is computed using </em><em>division</em>

<em>  output milesPerGallon</em>

<em>     //miles is misspelled, and the P in </em><em>milesPerGallon </em><em>should be uppercase</em>

<em>STOP</em>

<em>  //</em><em>Program </em><em>should end with stop</em>

<em>//This pseudocode is intended to describe</em>

<em>//computing the </em><em>per day cost </em><em>of your rent</em>

<em>//in a 30-day month</em>

<em>START</em>

<em>  input rent</em>

<em>  costPerDay = rent / 30</em>

<em>     // Comment indicates 31-day month</em>

<em>  output costPerDay</em>

<em>     // output should be </em><em>costPerDay</em>

<em>STOP</em>

Learn more about the pseudocode here :

brainly.com/question/13208346

#SPJ1

3 0
10 months ago
What is a constructor? Why would you include a constructor in a class?
QveST [7]

Answer:

Constructor in the class is the member function that gets into action when any new object gets created in the class ,it gets invoked. It does not have any return type and no void return.

The constructor is used in the class because there is the requirement for the initializing of the new object and then only object can do the functioning in the program.

4 0
3 years ago
Successful Web sites such as StumbleUpon ( www.stumbleupon) and Digg ( www.digg) use ____ by inviting their visitors to vote on
aliina [53]

Answer:

"Crowdsourcing" is the correct answer for the above question.

Explanation:

  • Crowdsourcing is a term from which any organization advertises the thinks or can get the ideas or solutions for any particular problem.
  • It is a term that refers to the problem to the number of solvers to achieve the result correct and frequent.
  • For example, If anyone wants to prepare the two websites. Then he assigns the works to the number of people and the works done faster with the help of this.
  • The above question states that some websites can be successful with the help of the type of work. They are successful with the help of crowdsourced work. Because it saves time. So the answer is Crowdsourcing.
3 0
3 years ago
A(n) __________ port, also known as a monitoring port, is a specially configured connection on a network device that is capable
drek231 [11]

Answer:

The answer is "SPAN"

Explanation:

The full form of SPAN port is  "Switch Port Analyzer", which is used to designed specifically for the interface on a network device, that would be able to monitor all traffic passing across the entire device.

  • The use of this port will also call the mirror ports, that is a popular way of gathering data traffic for tracking purposes.
  • It is primarily used to access the bus switch and all interfaces, which is usually accessible from data transmission.
7 0
3 years ago
Other questions:
  • 1.
    13·1 answer
  • Assume the existence of a Bank Account class. Define a subclass, Savings Account that contains the following: a double instance
    5·1 answer
  • The cold war actually helped in the development of the internet true or false
    8·1 answer
  • A(n) _____ is a computer program that can damage files and programs on your computer.
    6·2 answers
  • What does RFID use for wireless communication?<br> Infrared<br> IoT<br> Smart chip<br> Tag
    14·1 answer
  • Which cable standard is a standard for newer digital cable, satellite, and cable modem connections?
    11·1 answer
  • Suppose a webpage contains a single text field. We want to make the page such that a user can immediately start typing in the te
    11·1 answer
  • Identify the angle.
    12·1 answer
  • PLEASE ANSWER THIS ASAP‼️
    10·2 answers
  • 1.1 give five (5) reasons why modeling is an important part of system analysis and design
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!