Question: Iterations Until Integer Equals Five.vi Write a program that randomly gener - ates an integer in the range from 1 to 1 0 and iterates

Iterations Until Integer Equals Five.vi Write a program that randomly gener-ates an integer in the range from 1 to 10 and iterates this random process until the integer equals 5. The number of iterations required until the randomly generated integer equals 5 is then displayed on the front panel in a Numeric Indicator, which is labeled Required Iterations as shown next.
To create a random integer in the range from 1 to 10, use Random Number
(01) to generate a random floating-point number in the range from 0 up to (but not including)1, multiply this number by 10, and then use Round Toward + Infinity to round the floating-point number to the next highest integer (note Round Toward + Infinity rounds x.000 to x) as shown here.
To check whether this integer equals 5, use the Equal? icon. Finally, think
carefully about how to use the While Loop-related icons to determine the value of Required Iterations. Knowing that the integers are created randomly (i.e., equal probability for
producing integers 1 through 10 each iteration), what do you expect the value of Required Iterations to be, on average? Run your VI 20 times and record the value of Required Iterations resulting from each run. Is the average of these 20 values close to the value that yoo
-Modify the program to create an indicator on the front panel that displays the randomly generated integer value. Why is this # always 5?
-Create a 500 ms delaa y in the program. Discuss why this changes the integer value display u expected?
Please include a block diagram as I have already created mine but it displays values over 10.
Iterations Until Integer Equals Five.vi Write a

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 Programming Questions!