Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making a random int
#1
Hello I've got this code, and I hope you can help me out a little bit.
[code2=java]import java.util.Random;
public class objectIntro {

public static void main(String[] args)
{
String a = "blabla";
String b = "lala";
Random weight = new Random();
//Random rnd = new Random();
//System.out.println("The weight is: " + rnd.weight(100));
if(weight <= 55)
{
System.out.println(b + "is slimmer then: "+ a);
}else if(weight >= 80)
{
System.out.println(a + " is fatter then: "+ b);
}

}

}[/code2]

So what does not work?
I want to make the weight int. random and later it can show who is fatter/smaller.
Like the output:

The weight it: (random generated) 83
blabla is fatter then lala

please help me.

GRTZ,
- mustafa6155


Messages In This Thread
Making a random int - by mustafa6155 - 03-23-2014, 03:52 AM
Re: Making a random int - by Fusion - 03-29-2014, 10:54 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)