DiceRoller.java
You are to write a program which will ask the user for the number and type of dice they would
like to roll in the form of “xdy”. The x represents the number of dice, and the y represents how
many sides the dice have. Your program MUST read the input as a string, then parse the data.
You may assume that the input is entered in the form of an integer, followed by the character “d”
followed by an integer.
Once you have the number of dice you will use the commands below to generate that many
random numbers between 1 and the largest number on the dice. You must display each value
that is rolled and then report the results to the user as well as the sum of all the rolls.
Input: Number and size of dice (String)
import java.util.Random;
Random randomGenerator = new Random();
int randomInt = randomGenerator.nextInt(n);<-- generates a random number between 0 and n-1
The program should ask for input and display output clearly and using English. For example:
Please enter the number and type of dice to roll.
5d8
Rolling: 2, 6, 1, 8, 6
The total amount rolled is 23.
I am having a lot of trouble and any help would be awesome :)