generate 2 random numbers, then multiply

March 4, 2013 at 13:12:10
Specs: Windows 7
I have to generate 2 random numbers between 0 & 9, and then have the user guess the product, so far I can only get it to generate 1 number for to do 2?
import java.util.Random;
public class multiply{
public static void main (String [ args){
Random randomNumbers=new Random();
int randomNumber=randomNumbers.nextInt(10);{

The above gives my one random number.

See More: generate 2 random numbers, then multiply

Report •

March 4, 2013 at 13:30:47
So call Random.nextInt() again.

How To Ask Questions The Smart Way

Report •

March 4, 2013 at 13:46:23
I realize that somehow I need to have it generate a 2nd time.
This is a beginning Java class and I have no idea how to make it do that...sorry
And I also need to assign these 2 numbers "x" & "y".

Report •
Related Solutions

Ask Question