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

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