Question: Write a program that will ask the user to input the number of dice to roll, and the number of sides on the dice.

Write a program that will ask the user to input the number


Write a program that will ask the user to input the number of dice to roll, and the number of sides on the dice. It will then roll the dice and show the results of each roll as well as the total of the dice rolls. Your program must use a method to simulate the rolling of the dice. Submit your complete Java code (source code only, java file) by due date Sample Execution 1: Enter the number of dice to roll: 5 Enter the number of sides on the dice: 15 Dice #1 Comes up: 5 Dice #2 Comes up: 4 Dice #3 Comes up: 6 Dice #4 Comes up: 4 Dice #5 Comes up: 13 After rolling 5 dice with 15 sides, the total is: 32 Sample Execution 2: Enter the number of dice to roll:7 Enter the number of sides on the dice:8 Dice #1 Comes up: 3 Dice #2 Comes up: 6 Dice #3 Comes up: 6 Dice #4 Comes up: 4 Dice #5 Comes up: 1 Dice #6 Comes up: 1 Dice #7 Comes up: After rolling 7 dice with 8 sides, the total is: 22

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the Java code that simulates rolling dice based on user input java import javautilRandom impor... View full answer

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 Programming Questions!