Write a Dice class. The class should have: • A private field for the number of sides of the die A constructor that takes an integer between 4 and 20, inclusive and sets the number of sides of the die...

JVWrite a Dice class. The class should have:<br>• A private field for the number of sides of the die<br>A constructor that takes an integer between 4 and 20, inclusive and sets the number of sides<br>of the die<br>• A method, tolUDie0, returns the face value when the die is rolled. Use a Random number to<br>

Extracted text: Write a Dice class. The class should have: • A private field for the number of sides of the die A constructor that takes an integer between 4 and 20, inclusive and sets the number of sides of the die • A method, tolUDie0, returns the face value when the die is rolled. Use a Random number to "roll" the die. Write a driver program. This program should create two die with the same number of sides, continually roll the dice and report the result of each roll. It should stop when "snake eyes" are rolled (double l's) and report the number of rolls. You may write this as a console application or a Windows Forms application. Here's an example: Form Roll Dice 1 1 It took 24 rols to get snake eyes OK

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here