Question: Integers seedVal and numSides are read from input. numSides represents the number of faces of a die. Complete the followir tasks: Call randGen's setSeed (
Integers seedVal and numSides are read from input. numSides represents the number of faces of a die. Complete the followir tasks:
Call randGen's setSeed with seedVal as the argument.
Assign variables dieRoll dieRoll dieRoll and dieRoll each with a random dice roll between and numsides, both inclusive.
Assign variable sumAll with the sum of dieRoll dieRoll dieRoll and dieRoll
Click here for example
Ex: If numsides is then one possible output is:
Sum:
Note: Polyhedral Dice are common in certain board and roleplaying games.
import java.util.Random;
import java.util.Scanner;
public class GenerateRandomNumbers
public static void mainString args
Scanner scnr new Scanner
System.in;
Random randGen new Random;
int seedVal;
int sumAll;
int numsides;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
