Question: Write a Die class that will be rolled in your program to produce a value. Once the Die is rolled it should retain a value.

Write a Die class that will be rolled in your program to produce a value. Once the Die is rolled it should retain a value. The data needed to support this class is simply an integer value that your roll() function will maintain values from 1-6. The functionality needed are the member functions:
1) roll()- will set the value to a randomly generated value between 1-6
2) GetValue()- will return the value that was generated
3) FormattedPrint()- will display the value in formatted form. For example, if the value is 3, a call to Formatted Print will produce:

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!