Modify the existing vector's contents, by erasing the element at index 1 (initially 200), then inserting 100 and 102 in the shown locations. Use Vector ADT's erase() and insert() only, and remember...


Modify the existing vector's contents, by erasing the element at index 1 (initially 200), then inserting 100 and 102 in the shown 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 with input 33 200 10:


#include
#include
using namespace std;


void PrintVectors(vector numsList) {
unsigned int i;


for (i = 0; i < numslist.size();="" ++i)="">
cout < numslist.at(i)="">< "="">
}
cout <>
}


int main() {
vector numsList;
int userInput;
int i;


for (i = 0; i < 3;="" ++i)="">
cin >> userInput;
numsList.push_back(userInput);
}


/* Your solution goes here */


PrintVectors(numsList);


return 0;
}


Please help me with this problem using c++.



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here