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
705 over 224 divide by 224 over 224
dybincka [34]
(705/224) / (224/224)
224/224 = 1.
So (705/224) / (224/224) = (705/224) / (1/1).
Dividing 2 fractions is equal to multiplying the first fraction by the inverse of the second:
(705/224) / (1/1) = (705/224) * (1/1) = 705/224.

Hope this Helps! :)
5 0
3 years ago
The difference between chemical and physical digestion
juin [17]
Differences between<span> a </span>physical and chemical change<span> in matter or substances</span>
3 0
3 years ago
A tall pea plant (TT) is crossbred with a short pea plant (tt). The Punnett square below shows the separated alleles for two pea
musickatia [10]
Hi there! 

Using the image below, you can see that all of the boxes are Tt, or heterozygous. Therefore, 1 = Tt, 2 = Tt, 3 = Tt, and 4 = Tt.

Hope this helps!! :)
If there's anything else that I can help you with, please let me know!

6 0
2 years ago
Read 2 more answers
1. 80 feet<br> 2. 40 feet <br> 3. 20 feet<br> 4. 30 feet
andrey2020 [161]

Answer:

30 feet

Explanation:

7 0
3 years ago
Fleas are commonly seen on the bodies of dogs. These fleas attach themselves to the host and draw blood as nourishment. Apart fr
Slav-nsk [51]
I believe the correct answer among the choices listed above is option A. Parasitism is the kind of interaction that is shown here. Parasitism is a kind of relationship where one feed off the other. Fleas here are referred to as the parasite and the dog is the host.
8 0
3 years ago
Other questions:
  • what would be the first thing you would do if you were burned by a chemical a.apply the antidote for the chemical b.rinse the ar
    9·1 answer
  • Match the chemical name of the different vitamin compounds (vitamers) with the appropriate description.
    8·1 answer
  • A scientist owns a company that is producing a new chemotherapy drug and the scientist is doing the research?
    12·1 answer
  • Clouds act in much the same way as high humidity in Earth's atmosphere. The presence of clouds means moist, humid, atmospheric c
    14·2 answers
  • A cross between a blue blahblah bird &amp; a yellow blahblah bird produces offspring that are green.  The color of blahblah bird
    12·1 answer
  • Which statement best explains how mutations change the shape of flu virus antigens, preventing the attachment of antibodies?
    10·1 answer
  • A DNA molecule carries information that specifies some traits of an organism. This information is found in the-
    7·1 answer
  • PLEASE HELP ASAP!!
    9·2 answers
  • Asthenosphere is the
    13·1 answer
  • A group behavior that is more common in bony fish than a cartilaginous fish is
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!