Chapter 10 Exercise Set 1ΒΆ

  1. Write a program to generate 10 random numbers between 1 and 10.

  2. Rerun the how_many experiment from the Counting section with larger values for num_values and describe your results. Try calling srand seeded with the current time. Repeat this several times, documenting your results.

  3. Encapsulate the single pass histogram from the A histogram section in a function named histogram that takes a vector and a range of values in the vector (which was 0 through 9 in the example), and returns a histogram of the values in the vector.