Finished. Thanks.

Printable View

- 03-13-2009, 06:37 PMChristopher The GreatHelp with class project, random number generator.
Finished. Thanks.

- 03-13-2009, 06:48 PMbobix
Here is a simple solution:

import java.util.Random;

public class RandomNumber {

/**

* @param args

*/

public static void main(String[] args) {

Random generator = new Random();

int a = generator.nextInt(50);

int b = generator.nextInt(50);

int c = generator.nextInt(50);

System.out.println(a+" "+b+" "+c);

if ( (a<b) && (a<c) )

System.out.println(a);

if ( (b<a) && (b<c) )

System.out.println(b);

if ( (c<a) && (c<b) )

System.out.println(c);

}

} - 03-13-2009, 06:53 PMEranga
You just want to generate three random numbers. Assign them into three variables, and compare with each other.

- 03-13-2009, 06:55 PMChristopher The Great
I got mine to work with a good bit of tweaking and adding. Thanks for the help.

- 03-14-2009, 03:12 AMEranga
If you have solve the problem please mark the thread solved, from thread tools menu.