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
Advocard [28]
3 years ago
12

Modify the existing vector's contents, by erasing the element at index 1 (initially 200), then inserting 100 and 102 in the show

n locations. use vector adt's erase() and insert() only, and remember that the first argument of those functions is special, involving an iterator and not just an integer. sample output of below program:
Biology
1 answer:
Aleonysh [2.5K]3 years ago
7 0

Answer:

Following are the code to this question:

#include <iostream>//defining header file

#include <vector>//defining header file

using namespace std;

void PrintVectors(vector<int> numsList)//defining a method PrintVectors that accept an array

{

   int j;//defining integer variable

   for (j = 0; j < numsList.size(); ++j)//defining for loop for print array value  

   {

       cout << numsList.at(j) << " ";//print array

   }

   cout << endl;

}

int main()//defining main method  

{

   vector<int> numsList;//defining array numsList

   numsList.push_back(101);//use push_back method to insert value in array

   numsList.push_back(200);//use push_back method to insert value in array

   numsList.push_back(103);//use push_back method to insert value in array

   numsList.erase(numsList.begin()+1);//use erase method to remove value from array

   numsList.insert(numsList.begin(), 100);//use insert method to add value in array

   numsList.insert(numsList.begin()+2, 102);//use insert method to add value in array

   PrintVectors(numsList);//use PrintVectors method print array value

   return 0;

}

Output:

100 101 102 103  

Explanation:

In the above-given code, inside the main method an integer array "numList" is defined, that use insert method to insert value and use the erase method to remove value from the array and at the last "PrintVectors" method is called that accepts a "numList" in its parameter. In the "PrintVectors" method, a for loop is declared, that prints the array values.

You might be interested in
What is the role of auxin in plants​
Sophie [7]

Answer:

Auxin is a key regulator of plant growth and development, orchestrating cell division, elongation and differentiation, embryonic development, root and stem tropisms, apical dominance, and transition to flowering

Explanation:

Hope this helps you

3 0
2 years ago
Read 2 more answers
Choose all the answers that apply.
Galina-37 [17]
A. cycles B. equilibrium C. change D. models E. scientific method
all these would be found in science.
7 0
3 years ago
Read 2 more answers
wind energy gaining support as a possible energy source for people. what is the source of the energy that generated wind?
Ivahew [28]

<u>Answer</u>: The energy source that generates wind is actually the sun.

<u>Explanation</u>: The uneven heating of the Earth's surface by the sun gives rise to differences in atmospheric pressure. Areas such as deserts will warm the air masses above much more. As air is heated, it has a lower density as it expands and thus will form a point of low atmospheric pressure. The opposite situation applies for high pressure areas.The air movement from areas of high pressure to areas of lower pressure is what we call wind.

3 0
3 years ago
The major organs which control acids and bases in the body are:
sertanlavr [38]

Answer:

1. kidneys 2. Lungs 5. Pancreas

Explanation:

The body's balance between acidity and alkalinity in the human body is regarded as the acid-base balance which is measured on the basis of the pH and the concentration of carbon dioxide and bicarbonate in the blood. The organs that controls acid-base balance are lungs, kidneys and pancreas. Theses organs control blood pH by releasing carbon dioxide from the lungs because it is a waste product slightly acidic in nature and excreting excess of acids and bases from the body.

7 0
3 years ago
Define Biosystematics ???​
Norma-Jean [14]

Answer:

\color {pink}\boxed{\colorbox{black} { QUESTION♡}}

Define Biosystematics ???

\color {blue}\boxed{\colorbox{white} {✦Answer✦}}

taxonomy based on the study of the genetic evolution of plant and animal populations.

\color {blue}\boxed{\colorbox{white} {✦hope helps uh

3 0
2 years ago
Read 2 more answers
Other questions:
  • A bowhunter's quarry is antelope, deer, black bear, or other big game of similar size or smaller. Which shot offers a good chanc
    9·2 answers
  • Which of the colors absorbed by chlorophyll is least visible?
    8·1 answer
  • The water, carbon and nitrogen cycles are examples of what type of cycle?
    7·1 answer
  • Which factor is most important for photosynthesis to occur in plants?
    7·2 answers
  • Can someone help me with some biology quizzes?? i'm in pre AP 9th grade biology
    12·2 answers
  • In simple dominance what is the result when a dominant allele pairs up with a recessive allele
    14·1 answer
  • Best answer gets brainliest
    13·1 answer
  • Plz! Its about starss!! Look at the HR diagram below with four stars labeled.
    9·2 answers
  • Information found on the chromosome of an organism would MOST affect which statement?
    15·1 answer
  • Which of the following describe ecosystem services?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!