Question: In c++ using vector The purpose of this project is to generate thirty random whole numbers between 1 and 10, insert them into a vector

In c++ using vector
The purpose of this project is to generate thirty random whole numbers between 1 and 10, insert them into a vector in descending order, then and print the numbers in ascending order: Use the following plan of attack: 1. Create an empty vector of int elements. 2. Use the srand function to change the "seed" for generating random numbers so that the rand function will generate a different set of random numbers every time your program is run. 3. Use the rand function to generate a random number whole number between 0 and RAND_MAX (using Dev-C++, RAND_MAX is 32,767). 4. Convert this number into a number between 1 and 10. o hint: use the % operator. 5. Use a loop to scan the vector until you find the position of an element containing a number that is less than the random number just generated above. 6. Use an iterator to insert the random number into the vector at that position. 7. Go back to step 3 and perform again until the vector contains 30 random numbers 8. After all 30 numbers have been generated and inserted into the vector, they should appear in descending order in the vector. 9. Use the pop_back function in a loop to print the numbers in ascending order on the console until the vector is empty
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
