Question: USING JAVA Task : Try different values of a, b, and m to get your random number generator method to produce at least 6 values.

USING JAVA Task: Try different values of a, b, and m to get your random number generator method to produce at least 6 values. Hint: think about how the mod operation works; larger values of m may be to your benefit. When you have accomplished this task, your test will pass.

public class Main { public static int random(int n) { int Rn = 0; int n1, n2; final int a=5, b=7, m=12; for (int i=0; i

public static void main(String [] args) { System.out.println("The 10th random number is " + random(10)); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!