I need to know whats going wrong here with these codes and the errors. Please he
ID: 3909570 • Letter: I
Question
I need to know whats going wrong here with these codes and the errors. Please help.
Type two statements that use nextint0 to print 2 random integers between (and including) 100 and 149. End with a newline. Ex: 112 102 1 import java.util.Scanner; 2 import java.util.Random; 4 public class RandomGenerateNumbers 5 public static void main (String [] args) new Random(); Random randGen int seedVal; seedVal = 4 randGen.setSeed (seedVal); 18 12 Et firstNum 149-180 + 1; 13 int secondNum=randGen.nextInt(firstNum); 14 System.out.println( (188secondNum)); 15 secondNum=randGen.next Int(firstNum) ; 16 System.out.println( (188secondNum)); 17 18 eturn; 19 28 Run Failed to compile main.java: 394: error: unreachable statement randGen.setSeed (seedVal); main.java: 412: error: unreachable statement randGen.setSeed (seedVal) 2 errorsExplanation / Answer
import java.util.Random;
public class RandomGenerateNumbers {
public static void main(String[] args) {
Random randGen = new Random(4);
System.out.println(100 + randGen.nextInt(50));
System.out.println(100 + randGen.nextInt(50));
}
}