-8

I need to create a random number between 80 and 120, I was given the line

int tempF = (-17 + (int) (Math.random() * ((-20 - (-17)) + 1)));

and I added the line

Random generator = new Random();

above it, but I'm not sure where to go from here?

Pshemo
  • 122,468
  • 25
  • 185
  • 269

1 Answers1

0

Use something like this:

Random ran = new Random();
int x = ran.nextInt(10); //where 10 is range
Jebathon
  • 4,310
  • 14
  • 57
  • 108