8.6) Exercise 15
- Copy your solution to Exercise 11 or Exercise 12 (it doesn't matter which) to a new file. Add to this new program some code to display the contents of your vector or list, one element per line. Use a
for
loop and the appropriateconst_iterator
to do this. Check that your program compiles and runs successfully before proceeding any further. - Add code that scales the values in your vector or list, multiplying each value by 0.5. Use a
for
loop and the appropriateiterator
to do this. - Add one
for
loop that displays the contents of your vector or list. You can just copy the code added in Step 1 for this. Compile and run your program to check that it behaves as expected.