logo CodeStepByStep logo

randomOver

Language/Type: Java parameters loops random
Related Links:

Write a method named randomOver that accepts two integer parameters n and max and repeatedly prints random numbers between 0 and max (inclusive) until a number greater than or equal to n is printed. At least one line of output should always be printed, even if the first random number is above n. Here is a sample log from the call of randomOver(900, 1000);

Random number: 235
Random number: 15
Random number: 810
Random number: 147
Random number: 915
Method: Write a Java method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.