Write down the answers first. Click the to check your answer and to hide the answer.
1. Given the code below, what values could number have?
1 or 2, because it is from 0 to 3 exclusive
2. Given the code below, what values could num have?
A random value from 10.0 to 11.0
3. Given the code below, what values could num have?
A random value of 2, 3, 4, 5, 6, 7, 8 or 9
4. In the code below, how many different values can num have?
5. In this code, what does the bear comlain about most?
He says I'm tired about 60% of the time.
6. If you want num to represent flipping a coin, what value should you give num?
Any 2 values will work:
7. If you want to select a random amount to jump, what type should you use?
8. If you want to select a random number of times to jump, what type should you use?
9. Which has more values RandomUtilities.nextIntegerFromAToBExclusive( 1, 3 ); or RandomUtilities.nextIntegerFromAToBInclusive( 1, 3 );
Inclusive: it includes the values 1, 2, 3. Exclusive is just 2
10. Integer sayIt = RandomUtilities.nextIntegerFromAToBInclusive( 0, 3 );A loop executes sayIt times. Is it possible that the loop exceutes 0 times?
Yes, sayit can be 0.
Please review the materials for any questions you miss.