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
If a cell contains 96 chromatids in metephase I of meiosis I, how many chromosomes will the daughter cells contain after meiosis
leva [86]

Answer:

After meiosis II each daughter cell contain 24 chromosomes.

Explanation:

Four daughter cells are produced in a single meiosis. so each cell recieve only 24 chromosomes.

5 0
3 years ago
Which of the following statements is true about the Big Bang Theory?
Natali [406]
Everything in the universe was created when the Big Bang occurred and the universe is expanding
7 0
2 years ago
5. What would our planet be like without plants?​
lions [1.4K]

Answer:

we would die plants give us oxgen fruits and vegtebales  . trees for example we need wood and there leaf to make  doors and paper

Explanation:

8 0
3 years ago
Read 2 more answers
Name two properties of a good marker and explain why good markers are important.
Semenov [28]

Answer:

The overview is defined in the clarification section elsewhere here, and according to the particular circumstance.

Explanation:

Including genetic mapping as well as tracing the characteristics of hereditary disorders, genetic markers are valuable.

Basic DNA sequence determination for chromosomes.

  • Healthy Marker Properties.
  • This needs to have been Polymorphic.
  • It is indeed meant to be non-epistatic.
  • Throughout the genome, these are distributed uniformly.
3 0
2 years ago
Why was the discovery of the Australopithecus afarensis child, nicknamed “Selam,” such a significant finding with regards to hom
Sergeu [11.5K]
Nanakakskskakkakalalalallkalalalakakkaak

4 0
1 year ago
Other questions:
  • Please Help me I will give out extra points. This type of cell contains a nucleus and organelles that are surrounded by membrane
    13·2 answers
  • Why is the kingdom protista considered the "junk drawer"
    6·1 answer
  • The blood pressure is regulated partly by ________, which measure blood pressure and are located in the aorta and carotid arteri
    11·1 answer
  • Concept 22.1: The Darwinian revolution challenged traditional views of a young Earth inhabited by unchanging species • Describe
    6·1 answer
  • Which of the following is not a surface of the lungs?
    13·2 answers
  • What polysaccharide provides rigidity and strength in plants? Brainliest and 10 points Glycogen Starch Cellulose Chitin
    13·1 answer
  • Determine whether the characteristics describe DNA replication in prokaryotes only, eukaryotes only, or both prokaryotes and euk
    15·2 answers
  • Which one is a chemotroph?
    5·2 answers
  • Phrenology is an entire medical discipline, where practitioners "read" the bumps and dents on the skull to gain insight into a p
    15·1 answer
  • The question is in the picture
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!