In the first question, first, the variable "A" is given a random value in the interval [2, 5} (A = 2, 3, 4, or 5). Then "B" is assigned the value 6, 7, 8 or 9 in the second format code string. Then the value of A and the value of B are substituted with " + " between them, then, after the characters " = ", the value of A+B is substituted, then a "." is added.
In the second question, "F" is the number of friends little Johnny has (2, 3, 4, 5, 6, 7, 8, or 9). "B" is the number of beans (I didn't say it was a good problem, I said it was an example problem...)
The third problem uses "h" (same as "H"), "t", and "d" to represent random digits, then creates a number "n" from these digits. Notice that the value of "n" is displayed with 3 decimal places. ({$n"3}
\TITLE Random Values Demo \TF A T {$A=RNI(2,5)}{$B=RNI(6,9)}{$A} + {$B} = {$A+B}. \MC A C B A {$F=RNI(2,9)}{$B=3*F}Johnny has {$F} friends. Each of Johnny's friends has {$B} beans. How many beans are there all together? A. {$F} B. {$2*F} C. {$F*B} D. {$B} \FF A 6 {$h=rni(1,9)}{$t=rni(1,9)}{$d=rni(1,9)} {$n=100*h + 10*t + 0.001*d}The measurement {$n:3} seconds has how many significant digits?
The following applet runs this question file: