Redo the first exercise from § 3.3.3 (p. 105) using iterators.
§ 3.3.3 (p. 105)
Exercise 3.16
Write a program to print the size and contents of the vectors from exercise 3.13. Check whether your answers to that exercise were correct. If not, restudy § 3.3.1 (p. 97) until you understand why you were wrong.
Exercise 3.13
How many elements are there in each of the following vectors? What are the values of the elements?
(a) vector
v1; (b) vector
v2(10); (c) vector
v3(10, 42); (d) vector
v4{10}; (e) vector
v5{10, 42}; (f) vector
v6{10}; (g) vector
v7{10, "hi"};
§ 3.3.1 (p. 97)
Exercise 3.12
Which, if any, of the following vector definitions are in error? For those that are legal, explain what the definition does. For those that are not legal, explain why they are illegal.
(a) vector
> ivec; (b) vector
svec = ivec; (c) vector
svec(10, "null");
Exercise 3.17
Read a sequence of words from cin and store the values a vector. After you’ve read all the words, process the vector and change each word to uppercase. Print the transformed elements, eight words to a line.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.