Thanks for all the help!
Printable View
Thanks for all the help!
i figure your new so atleast look this over...
Code:int total = 0, count = 0, r;
Random randomGenerator = new Random();
do{
r = randomGenerator.nextInt(11)+1;
total = total + r;
count++;
}
while(total <= 21);
System.out.println(count);
}
Thank you so much, you are amazing!
Don't edit your posts like that. Now this post is of no value to anyone else.
Here's the original content:
kind regards,Quote:

How would I generate random numbers between 111 and when they total up to 21 or greater the systems tells me how many generated
numbers there were that added up to 21?
I have this so far, I think I am suppose to use RandomNumber command.
for (int i = 1; i < 11; i++)
Jos
OP aksed, "How would I generate random numbers between 111 and when they total up to 21 or greater the systems tells me how many generated
numbers there were that added up to 21?"
Hmm, what is the count when the first eight generated numbers are 4,8,3,2,4,9,10,1?
Regards,
Jim