answer.
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]
2 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]2 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
Suzanne wants to conduct research on the growth of pollution in the United States between the years 2005 and 2015. She believes
Zanzabum

Geographic Information Systems (GIS) tool will allow Suzanne to analyze and visualize data on a map. Geographic Information Systems is a computer-based tool that is used for analyzing, storing, manipulating and visualizing geographic information, usually in a map. GIS can include information about location, people, landscape and sites of factories.






6 0
1 year ago
Read 2 more answers
Humanity’s ecological footprint is already overburdening the Earth, but, approximately 1/3 of the world population lives on less
soldier1979 [14.2K]

Answer:

Use of recycled products and renewable energy.

Explanation:

Use of recycled products and use of renewable energy are the solutions which provide resources to everyone and no damage cause to the ecological systems of the environment. By using recycled products have two advantages i. e. the product's price decreases and no pollution occurs while the use of renewable energy such as use of solar radiation for the production of electricity. With this energy, no pollution occurs in the environment and electricity can be provided to a lot of people with low cost.

6 0
2 years ago
Characteristics of the early u.s. navy "super frigates" included ______________. select all that apply.
Stolb23 [73]

The original six frigates of the United States Navy<span> came up with the Naval Act of 1794. Two<span> characteristics are distinct of these said  early US. Navy "super frigates. They are: </span></span>

<span>·         </span><span>timbers put close together to be  able to withstand heavy cannon fire</span>

<span>·         </span><span>hull reinforced to resist the pressures of heavier ordnance on deck</span>

4 0
2 years ago
The Clean Air Act imposes permit requirements for stationary sources of pollution. Which states are most likely to oppose strict
8_murik_8 [283]
I'm pretty sure we have the same class. And you got your answers mixed up with the question. But the correct answer is D) states whose economies rely on coal, oil, or gas. Good luck.
7 0
2 years ago
Read 2 more answers
Select the correct answer. Which of the following is an example of a beneficial mutation? A. a mutation causing uncontrolled cel
emmainna [20.7K]
B. A mutation inhibiting human immunodeficiancy virus from entering the host cell.
Please mark as brainliest.
4 0
2 years ago
Read 2 more answers
Other questions:
  • List examples of biological macromolecules that rely on hydrogen bonding
    9·2 answers
  • What commonly ingested substances are absorbed through the stomach wall?
    11·1 answer
  • Sort the statements based on whether they describe DNA replication in eukaryotes or prokaryotes. Replication takes place in the
    7·2 answers
  • To cells that are defective in primer removal, you add fluorescent ribonucleotides when the cells are undergoing dna replication
    15·1 answer
  • When a neuron fires and its electric charge travels down the axon, causing neurotransmitters to be released by the neuron's term
    8·1 answer
  • Explain how the reproductive strategies of mosquitoes and elephants help them overcome the natural threats of their environments
    15·3 answers
  • Which of the following is often provided by anthropologists and biologists as a possible explanation for the development of bipe
    11·2 answers
  • What acts as a source of heat in the mantle and results in mantle convection?
    7·2 answers
  • The ATP that is generated in glycolysis is produced by substrate-level phosphorylation, a very different mechanism than the one
    13·2 answers
  • A haploid species has a gene on chromosome 2 which codes for lactase. In nature, four different alleles of the lactase gene have
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!