yes that what im asking. i need the number to stay the same so if i have an instance variable, called int randomNumber. and had this returned would it stay the same?
Type: Posts; User: chonch
yes that what im asking. i need the number to stay the same so if i have an instance variable, called int randomNumber. and had this returned would it stay the same?
no cuz im not sure on the return if i leave num as the return does it stay the same number until user guess the right price and my showstatus says "your right"
ok i have this now
public int generateQuestion()
{
Random rand = new Random();
int num = rand.nextInt(51) + 101;
questionLabel.setText( "Guess oil price (100 - 150)" );
return num;
}
stuck at generating the number from 100 -150.
need to write write a Java applet that will let the user guess the gas price and compare it with the price predicted by my program. Guess gas price (100 - 150): that never changes. so far i have this...