You have three identical prizes to give away and a pool of 10 finalists. The finalists are assigned numbers from 1 to 10. Write a program to randomly select the numbers of 3 finalists to receive a prize. Make sure not to pick the same number twice. For example, picking finalists 3, 6, 2 would be valid but picking 3, 3, 11 would be invalid because finalist number 3 is listed twice and 11 is not a valid finalist number. Random number generation is discussed in Chapter 6, but for this problem you can insert the following line of code to generate a random number between 1 and 10:
```
int num = (int) (Math.random() * 10) +1;
```
This project uses random numbers in a loop. You might wish to introduce the Random class instead of Math.random().
See the code in RandomWinners.java.
Computer Science & Information Technology
You might also like to view...
What does a folder contain?
a. Word pad b. Memory c. Help features d. Files
Computer Science & Information Technology
If you move a folder to a different location on the same volume, that folder will lose its permissions
Indicate whether the statement is true or false
Computer Science & Information Technology