/* from Astrachan, p 195 */ #include using namespace std; #include "dice.h" // simple program illustrating use of Dice class // roll two dice, print results, Owen Astrachan, 8/9/94 int main() { Dice cube(6); // six-sided die Dice dodeca(12); // twelve-sided die cout << "rolling " << cube.NumSides() << " sided die" << endl; cout << cube.Roll() << endl; cout << cube.Roll() << endl; cout << "rolled " << cube.NumRolls() << " times" << endl; cout << "rolling " << dodeca.NumSides() << " sided die" << endl; cout << dodeca.Roll() << endl; cout << dodeca.Roll() << endl; cout << dodeca.Roll() << endl; cout << "rolled " << dodeca.NumRolls() << " times" << endl; return 0; } /* Sample output promptdr> roll rolling 6 sided die 5 4 rolled 2 times rolling 12 sided die 3 11 8 rolled 3 times */