Step-by-Step Instructions Step 1: Download and Open the UseSuperBase.java File Download the UseSuperBase.java file, and open it in jGrasp (or a text editor of your choice). Note that you should not edit this file, though you will need to be aware of the code it contains. Step 2: Download and Open the UseSuperMain.java File Download the UseSuperMain.java file, and open it in jGrasp (or a text editor of your choice). Note that you should not edit this file, though you will need to be aware of the code it contains. Step 3: Edit UseSuperSub.java Download the UseSuperSub.java file, and open it in jGrasp (or a text editor of your choice). You will need to add code to this file so that it compiles and UseSuperMain.java ends up producing the correct output. The comments in the file provide more details. Once you have your code working correctly, UseSuperMain.java should produce the output All ok when run. // DO NOT MODIFY ANYTHING IN THIS FILE!! import java.util.Random; public class UseSuperBase private Random random; public UseSuperBase (long seed) random = new Random(seed); public int nextInt(int high) { return random.nextInt(high); 7/ DO NOT MODIFY ANYTHING IN THIS FILE!! public class UseSuperMain { public static void main(String[] args) { long seed = Long. parseLong(args[0]); int high = Integer.parseInt(args[1]); int addThis = Integer.parseInt(args[2]); UseSuperBase base = new UseSuperBase (seed); UseSuperSub sub = new UseSuperSub(seed, addThis); if (base.nextInt(high) + addThis != sub.nextInt(high)) { System.out.println(“Mismatch!”); } else { System.out.println(“All ok”); public class UseSuperSub extends UseSuperBase { private int addThis; public UseSuperSub(long seed, int addAmount) { // TODO – write your code below this comment. // You’ll need to save addAmount in the // addThis instance variable, and initialize 17 the super class with super. public int nextInt(int high) { 11 TODO – write your code below this comment. 17 You’ll need to call the nextInt method 77 of the superclass, and then add addThis to // the result. Show transcribed image text Step-by-Step Instructions Step 1: Download and Open the UseSuperBase.java File Download the UseSuperBase.java file, and open it in jGrasp (or a text editor of your choice). Note that you should not edit this file, though you will need to be aware of the code it contains. Step 2: Download and Open the UseSuperMain.java File Download the UseSuperMain.java file, and open it in jGrasp (or a text editor of your choice). Note that you should not edit this file, though you will need to be aware of the code it contains.
Step 3: Edit UseSuperSub.java Download the UseSuperSub.java file, and open it in jGrasp (or a text editor of your choice). You will need to add code to this file so that it compiles and UseSuperMain.java ends up producing the correct output. The comments in the file provide more details. Once you have your code working correctly, UseSuperMain.java should produce the output All ok when run.
// DO NOT MODIFY ANYTHING IN THIS FILE!! import java.util.Random; public class UseSuperBase private Random random; public UseSuperBase (long seed) random = new Random(seed); public int nextInt(int high) { return random.nextInt(high);
7/ DO NOT MODIFY ANYTHING IN THIS FILE!! public class UseSuperMain { public static void main(String[] args) { long seed = Long. parseLong(args[0]); int high = Integer.parseInt(args[1]); int addThis = Integer.parseInt(args[2]); UseSuperBase base = new UseSuperBase (seed); UseSuperSub sub = new UseSuperSub(seed, addThis); if (base.nextInt(high) + addThis != sub.nextInt(high)) { System.out.println(“Mismatch!”); } else { System.out.println(“All ok”);
public class UseSuperSub extends UseSuperBase { private int addThis; public UseSuperSub(long seed, int addAmount) { // TODO – write your code below this comment. // You’ll need to save addAmount in the // addThis instance variable, and initialize 17 the super class with super. public int nextInt(int high) { 11 TODO – write your code below this comment. 17 You’ll need to call the nextInt method 77 of the superclass, and then add addThis to // the result.
Expert Answer
Answer to Step-by-Step Instructions Step 1: Download and Open the UseSuperBase.java File Download the UseSuperBase.java file, and …