logo CodeStepByStep logo

RandomOver

Language/Type: C# 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 C# 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.