Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integers seedVal, lowerBound and upperBound are read from input. randGen.setSeed ( ) is called with seedVal as the seed. lowerBound and upperBound represent the range

Integers seedVal, lowerBound and upperBound are read from input. randGen.setSeed() is called with seedVal as the seed. lowerBound and upperBound represent the range of numbers that can be picked on a lottery ticket. Assign variables pick1, pick2, pick3, and pick4 each with a random number between lowerBound and upperBound, both inclusive.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 lowerBound;
int upperBound;
int pick1;
int pick2;
int pick3;
int pick4;
seedVal = scnr.nextInt();
lowerBound = scnr.nextInt();
upperBound = scnr.nextInt();
randGen.setSeed(seedVal);
/* Your code goes here */
System.out.println(pick1);
System.out.println(pick2);
System.out.println(pick3);
System.out.println(pick4);
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions