using dice std;
# include <cstdlib>
int dice( )
{
int. random_ interger = rand ( )
cout << random_ interger << end 1
}
<< moderator edit: added [code][/code] tags >>
. Write the member function definitions for each function listed:
1. Object Type: a pair of dice
Knows:
The value of each face (1 – 6)
Can Do:
Roll for new face values
Tell the value on each face.
Initialize the die to have a value of 1 on each face. To roll the die, use the rand() function, to generate a random number. In order to generate a random number between 1 and 6, use the following:
Number = rand() % 6 + 1;
rand() is located in <cstdlib>