Question: C++ For Engineers and Scientist 5.5 #12 (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters,
C++ For Engineers and Scientist
5.5 #12
(Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters, such as zerocount, onecount, twocount, and so forth to 0. Then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment zerocount; when 1 occurs , increment onecount; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
