hey everyone i am stuck with this program. im trying to make a number guessing game using loops and if statements. i know how to do them individually but i am struggling with doing them together. heres what i have so far and useful feedback is greatly appreciated. oh yeah its all supposed to be in the main.
import java. util .Scanner; import java.util.*; public class NumberGame { public static void main(String[] args) { Random random = new Random(); int rand = random.nextInt(1000); for(rand=1000; rand<=1000; rand++) { System.out.println("please enter a number between 1 and 1000"); if(guess<=500); } private int guess; } }
im not sure if i have the for loop set up right but the part thats got me all confused is the if statement.


LinkBack URL
About LinkBacks
Reply With Quote
by clicking the
button on their useful posts.