Question: Write the following method that returns a random number between start and end, excluding the numbers. public static int getRandom(int start, int end, int... numbers)

Write the following method that returns a random number between start and end, excluding the numbers.
public static int getRandom(int start, int end, int... numbers)
For example, invoking getRandom(1,100,4,8,95,93) returns a random number between 1 and 100 excluding 4,8,95,and 93. Write a test program that invokes getRandom(1,100,4,8,95,93) 45 times and displays the resulting numbers 15 per line using the format %4d.

Step by Step Solution

3.37 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class Exercise0713 public static void mainString args for int i 1 i best b... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Java Programming and Data Structure Questions!