Does this make a random number between 1 and 10?
I never exactly knew how this one works cause I would get zeros as well. Can you help?
int num1 = (int) (System.currentTimeMillis()%10);
Type: Posts; User: valenciajv
Does this make a random number between 1 and 10?
I never exactly knew how this one works cause I would get zeros as well. Can you help?
int num1 = (int) (System.currentTimeMillis()%10);
It said process completed. =D
Thank you.
I am not done with the whole thing yet. Time to resume my homework. =D
I guess that would make sense to convert into an int.
How about this?
String answerString = JOptionPane.showInputDialog(null,"Guess a number between 1 and 10");
int answer =...
They are this
int num1 = (int) (System.currentTimeMillis()%10);
String answer = JOptionPane.showInputDialog(null,"Guess a number between 1 and 10");
Hi I just had a quick question. I have this code
if (answer > num1)
JOptionPane.showMessageDialog(null,"Your answer is too high");
else if (answer < num1)
JOptionPane.showMessageDialog(null,...