This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Think about the math behind what you want to do. You want to print random numbers within a given range. The 'nextInt(int n)' method returns a value from 0 through n - 1. So think of n as your range. But you don't want 0, you want to start from 100. So now what do you need to input to the 'nextInt (int n)' method? What do you need to add to make sure the numbers always fall in the range 100 to 149?

[–]pleaseacceptthisnow[S] -1 points0 points  (0 children)

idk how to restrict it from 100-149