| Contact PSVM (Q & A) | Notes Below Audio | [toc] [prev] Slide 5 of 14 [next] |
|
|
| 1, 2, 3, 4, [5 (top)], 6, 7, 8, 9, 10, 11, 12, 13, 14, [Lab] |
|
Notes for Slide 05 The simple way to get a random number is to call the static method random() in the Math class. You are not supposed to be able to understand the previous sentence at this time, but the example shows you the code you need to get a random double value between zero and one. Notice that this double value can be used to produce an int value using multiplication and the static method doubleToInt() in the JJS class. 1, 2, 3, 4, [5 (top)], 6, 7, 8, 9, 10, 11, 12, 13, 14, [Lab] |