Ask Question

How do I write code in Java for "A spinner for a game has four possible options: blue, red, yellow, green. The chance of landing on each option is equal. Simulate using the spinner 15 times and reporting the resulting color."?

+4
Answers (1)
  1. 30 March, 18:48
    0
    What you need to do is to generate a random number between 1 and 4 (or0 and 3) 15 times. Each time you generate a number, you figure out which number it is and keep track of how many times you've seen that number. At the end, print out how many of each number you got.

    Good luck!
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “How do I write code in Java for "A spinner for a game has four possible options: blue, red, yellow, green. The chance of landing on each ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers