Question: USING C++ Write program that generates random number between spceified range 100 times and counts/ displays how often each number was generated using an integer
USING C++
Write program that generates random number between spceified range 100 times and counts/ displays how often each number was generated using an integer array of size N+1. All the elements in the array should be initialized to 0. Each time a new random number is generated, the corresponding element of the array should be incremented by 1.
use the following functions:
getUpperBound(lower, upper, MAX): asks user to enter upper bound of range possible for random number
getRandomNumber(lower, upper): invokes C++ random number generator. Returns numbers generated.
updateArray(counterArray, randoNum): accepts the array of counters and random numbers as parameters and then increments the appropriate element of the arry by one (element indexed by randomNum)
summaryInformation(array, size): displays appropriate summary information. ex. The number 0 was generated n times
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
