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 dieRoll1, dieRoll2, dieRoll3, and dieRoll4 each with a random dice roll between 1 and numsides, both inclusive.
Assign variable sumAll with the sum of dieRoll1, dieRoll2, dieRoll3, and dieRoll4.
Click here for example
Ex: If numsides is 10, then one possible output is:
3
4
1
2
Sum: 10
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 main(String[] args){
Scanner scnr = new Scanner(
System.in);
Random randGen = new Random();
int seedVal;
int sumAll;
int numsides;
 Integers seedVal and numSides are read from input. numSides represents the

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!