0

I should create a Java program called FindThatNumber.java. The program should generate 10 random integers between 1 and 100 (inclusive) using Math.pow( ) and then store them sequentially in an array. The program should then ask the user to enter a single integer. If the integer is in the array just entered, the program should respond "Bingo!"; otherwise, the program should respond "Sorry". The program should continue running until the user enters -999 to quit. (Hint: The code (int) (100 * Math.random( ) + 1) creates the required random number.)

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by jwenting
1

Ok -- this is what you should do:

Create a Java program called FindThatNumber.java. The program should generate 10 random integers between 1 and 100 (inclusive) using Math.pow( ) and then store them sequentially in an array. The program should then ask the user to enter a single integer. If the integer is in the array just entered, the program should respond "Bingo!"; otherwise, the program should respond "Sorry". The program should continue running until the user enters -999 to quit. (Hint: The code (int) (100 * Math.random( ) + 1) creates the required random number.)

Any questions ;) ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.