Question: Jump to level 1 Given the integer vector myVector with two elements and the input integer numAdded, resize myVector to add numAdded elements to the
Jump to level
Given the integer vector myVector with two elements and the input integer numAdded, resize myVector to add numAdded
elements to the vector.
After resizing myVector, the new elements are initialized with the default value
Ex: If the input is then the output is:
Start End
Start E End
Note: Assume that numAdded is a nonnegative intege#include
#include
using namespace std;
int main
vector listVals;
int listValsSize listVals.size;
int scaleVal;
int i;
listVals.at;
cin scaleVal;
for i ; i listVals.size; i
cout listVals.ati;
cout endl;
Your code goes here
for i ; i scaleVal listValsSize; i
listVals.ati;
for i ; i listVals.size; i
cout listVals.ati;
cout endl;
return ;
r
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
