Chapter 10 Exercise Set 0: Chapter ReviewΒΆ
Write a program to generate 10 random numbers between 1 and 10.
Rerun the
how_many
experiment from the Counting section with larger values fornum_values
and describe your results. Try callingsrand
seeded with the current time. Repeat this several times, documenting your results.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.