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
Why is the term cell theory appropriate?
insens350 [35]
A basic tenet of modern biology, first stated by Matthias Schleiden and Theodor Schwann in 1838–39, that cells<span> are the basic units of structure and function in living organisms. ... A </span>theory<span> of heredity must be reconciled with the </span>cell theory<span>.</span>
7 0
4 years ago
Why is oxygen important for all body cells?
Masja [62]

Answer:

Our body cells require oxygen to release energy.

Explanation:

The oxygen that we take in during respiration is used to break down the food we eat to release energy from it. When we breathe in oxygen, it diffuses into blood from the lung, where it is transported by red blood cells to the entire body to be used to produce energy.

8 0
3 years ago
What is the friction of this
Anestetic [448]

Answer:

i dont know

Explanation:

i dont know sory

3 0
2 years ago
Read 2 more answers
One of these differentiate grasslands from forests. *
mestny [16]

Answer:

B. High temperatures

Explanation:

the canopy of the forest cover the rest of the forest, so it is cooler

8 0
3 years ago
Read 2 more answers
In chickens, having feathers on legs is dominant to having featherless legs. In a population of 200 chickens, 128 have featherle
Neporo4naja [7]

Answer:

64

Explanation:

Since the population is in Hardy-Weinberg equilibrium and the equilibrium is defined by the equation

p² + 2pq + q²

where the frequency of the homozygous dominant allele F ( feathers on the leg ) = p²,

F of homozygous ( featherless legs) = q²

F of heterogyous ( carrier of featherless allele) = 2pq

F (q²) = 128/200 = 0.64

q = √0.64 = 0.8

and p + q = 1

p = 1 - 0.8 = 0.2

2pq = 2 × 0.2 × 0.8 = 0.32

number of chickens that are heterozgous for the feathered leg allele = 0.32 × 200 = 64

3 0
4 years ago
Other questions:
  • Here are a list of events that involve changes to genotype and phenotype. Arrange these events in sequential order, from first t
    9·1 answer
  • A tentative explanation to a question about the natural world is a
    9·1 answer
  • Which of the following statements lists the steps that occur in the Cell Cycle, in chronological order?
    14·2 answers
  • Tissue found in the ____________ that contains ____________ cells is called nervous tissue.
    12·1 answer
  • The binding of a neurotransmitter on a postsynaptic cell allows potassium ions to diffuse out of the cell. this would result in
    11·1 answer
  • Golgi apparatus meaning
    8·2 answers
  • What is the role of acetyl-CoA? Where does it fit into the Krebs cycle?
    8·1 answer
  • HELPPPPPPPP!!!! what is a mutation that a polar bear can have to help conserve energy and how do genetic mutations relate to chr
    8·1 answer
  • The process of condensation is occurring at what number?
    8·1 answer
  • What is template and what is complementary strand? Please help me need ASAP
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!