Question: Given a double vector myList, an input integer numValues, and an input double begNum, resize myList to numValues. Then, assign the elements of myList with

 Given a double vector myList, an input integer numValues, and an

Given a double vector myList, an input integer numValues, and an input double begNum, resize myList to numValues. Then, assign the elements of myList with doubles begNum * (i + 1), where i is the index of each element in the vector.

Ex: If the input is 5 7.0, then the output is:

7.0 14.0 21.0 28.0 35.0 

----------------------------

#include #include #include using namespace std;

int main() { vector myList; int numVals; unsigned int i; int numValues; double begNum;

cin >> numValues; cin >> begNum;

/* Your code goes here in C++ (THANK YOU) */

for (i = 0; i

return 0; }

Given a double vector myList, an input integer numValues, and an input double begNum, resize myList to numValues. Then, assign the elements of myList with doubles begNum * (i+1), where i is the index of each element in the vector. Ex: If the input is 57.0, then the output is: 7.014.021.028.035.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!