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 #include #include using namespace std;int main(){srand(time(NULL));//randomizes the seed to generate a new cohort of random numbers each runcout

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. You can generate a random number in C++ by doing the following:

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 cohort of random numbers each run cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!