Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started