Question: Write a C + + Program that does the following: 1 . Write a program that does the following steps: a . stores 1 6

Write a C++ Program that does the following:
1. Write a program that does the following steps:
a. stores 16 integer random numbers in a STL list container L.
The random numbers range in value (050). One can generate such numbers by invoking the random number generation function, rand() and using the %(mod)operator
Prior to using the rand() function, initialize the random number generator with the srand(17)
b. Print the entire list after filling the list container L
c. Add the value of 2 for all numbers that are odd in list L
d. Print the entire updated list L
e. Insert into list L the following values {25,6,37} at location 3
f. Print the updated size of the list L1
g. Print the entire updated list L
h. Find the maximum (maxVal) value in the latest updated list L print it
i. Remove the 4th element of latest updated list L
j. Print the entire updated list L
k. Erases all numbers divisible by 3
l. The STL list container contains the following member functions:
push_front(), push_back(), pop_front(), pop_back(), begin(), end()
insert(iterator, value), empty(), erase(itr), remove(value)

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!