Question
. A normal die (dice) has 6 faces. Each face shows a number from one to six. Create die class (MSDie). A die knows two
. A normal die (dice) has 6 faces. Each face shows a number from one to six. Create die class
(MSDie).
A die knows two things;
How many faces it has, Its current value.
A die has the following methods;
Constructor, to createa die.
Roll, to roll it and get a value between 1 and 6.
Get/ set value -
mRoll, multiple roll as the game normally has mor than one die. If the game uses
two dice then mRoll takes two as input, roll the die twice and adds the values and
returns the final value.
3. Once the die class is developed run a game with two dice and print the result.
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