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 2 atoms are present in all organic molecules
Liula [17]
I think carbon and hydrogen.
3 0
3 years ago
Read 2 more answers
How do microorganisms eliminate harmful material?
sladkih [1.3K]

Answer:

Explanation: As microorganisms, in particular bacteria, are found virtually everywhere, harmful microorganisms may be reduced to acceptable levels rather than actually eliminated. In food preparation, microorganisms are reduced by preservation methods such as cooking, cleanliness of utensils, short storage periods, or by low temperatures.

8 0
3 years ago
What do you think is meant by this statement: “Hip Hop and rap are connected but are separate terms: Hip Hop is a culture and ra
Fiesta28 [93]

Answer:

rap is about that life but pop is different it is not about tje life of a gangster

Explanation:

jshshbzhsujansbs

7 0
2 years ago
Vineyards and orchards operate all year round. What are some practices from the recommended list of physical/cultural control th
Sloan [31]

Answer:

Some practices from the recommended list of physical/cultural control that you could do year-round to help control pests are as follow:

1. We can use those plant species that are more competitive. These plant species include release of chemical toxins that suppress other plants and insects.

2. Use of large Hight quality seeds.

3. By using narrow spacing in row and increasing seeding rate.

4. By using shallow seeding technique which allow desired plant species to grow and develop faster above the surface of soil.

5. By ensuring that our plant species is perfectly placed in that growing environment which is optimized with every specs.

6. By rotating the crops

7. By rotating plant species with different growing cycles and seasonal cycles.

8. By rotating herbicides with alternative modes of action to delay the herbicide resistance development.

8 0
3 years ago
The brain contains ________ of interconnected neurons and glia
Alex787 [66]

The brain contains billions of interconnected neurons and glia. <span> Glia cells</span><span> enclosed the  neurons and provide support for and insulation between them. It  is also the most abundant </span>cell types in the central nervous system. While Neurons are the basic units of the nervous system and it is the most important part is the brain. 

<span> </span>

6 0
3 years ago
Other questions:
  • What is the study of carbon-containing compounds?
    8·1 answer
  • The nurse is assisting the client in planning care during exacerbations of ménière's disease. which diet would the nurse identif
    12·1 answer
  • Ellen is jogging. As her body's metabolism becomes more active, carbon dioxide levels increase, resulting in a decrease in pH. F
    8·1 answer
  • If the binding of the CAP-cAMP complex promotes transcription of the induced lac operon, then how does the negative control of t
    15·1 answer
  • People playing basketball game in a gymnasium make up a closed system with 17,125 J of energy. At the beginning of the game, the
    10·2 answers
  • According to the article on snakes, what unique characteristic has led scientists to study the paradise tree snakes of South Asi
    11·1 answer
  • A sample of basalt has smaller crystals than a sample of granite. What is the most likely reason for this? The basalt
    12·1 answer
  • The answer is 588m^2
    9·1 answer
  • What does the theory of evolution state
    12·1 answer
  • Which of the following glands does not secrete any hormones?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!