Question: 3 . 1 8 : Random numbers Jump to level 1 Integers seedVal and limitValue are read from input. randGen.setSeed ( ) is called with

3.18: Random numbers
Jump to level 1
Integers seedVal and limitValue are read from input. randGen.setSeed() is called with seedVal as the se val2, val3, and val4 each with a random number between 0 and limitValue -1, both inclusive.
Click here for example
Ex. If limitValue is 20, then one possible output is:
16
1
9
12
Sum: 38
import java.util.Random;
import java.util.Scanner;
public class GenerateRandomNumbers {
public static void main(String [] args){
Scanner scnr= new Scanner(System. in);
Random randGen = new Random ();
int seedVal;
int sum;
int limitValue;
int val1;
int val2;
int val3;
int val4;
seedVal = scnr. nextInt () ;
limitvalue = scnr. nextInt();
2
 3.18: Random numbers Jump to level 1 Integers seedVal and limitValue

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!