Question: You can generate a random number in C++ by doing the following: #include #include #include using namespace std;int main(){srand(time(NULL));//randomizes the seed to generate a new
You can generate a random number in C++ by doing the following: #include Write a program called problem1.cppthat will generate a random number in [1-6] twenty thousand times.You need to compute the probability of occurrence of each of the numbers. This is done by simply keeping track of how many times the number 1 occurred, how many times the number 2 occurred and so on, and then dividing each count by twenty thousand to compute the probability of occurrence. You can use a single dimensional array of size 7 (indexes 0..6). Each time a number occurs, you will increment the corresponding location in the array to keep track of how many times that number occurred.You will not need to use location at index 0 for this. 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
