Image

Imagepixelpoet wrote in Imagecpp

/*
1. Declare a Dice object

2. Roll the Dice object 5 times and print the result of each roll

3. Change the number of sides of your Dice object to 25 using the
appropriate class method (look in dice.h to find out which one).

4. Roll the object once to get a random number n between 1 and 25.

5. Roll the object n more times and print the result of each roll.

6. Use one of the class methods to find the number of times that
the object was rolled, and output the number of rolls.
*/

#include "dice.h"
#include
[Error: Irreparable invalid markup ('<iostream.h>') in entry. Owner must fix manually. Raw contents below.]

/*
1. Declare a Dice object

2. Roll the Dice object 5 times and print the result of each roll

3. Change the number of sides of your Dice object to 25 using the
appropriate class method (look in dice.h to find out which one).

4. Roll the object once to get a random number n between 1 and 25.

5. Roll the object n more times and print the result of each roll.

6. Use one of the class methods to find the number of times that
the object was rolled, and output the number of rolls.
*/

#include "dice.h"
#include <iostream.h>

void main()
{
//roll dice 5 times, output to screen
Dice d;
cout << "Rolling Dice 5 times......" << endl;

for (int i = 0; i < 5; i++)
{
cout << d.roll() << endl;
}

//change sides of dice
d.setNumSides(25);

//get random num n (1-25)
int n = d.roll();
cout << "Random number is " << n << endl;

//rolls dice n times, and prints result of each roll
for (int j = 0; j < n; j++)
{
//cout << "Rolling. . .";
cout << d.roll() << endl;
}

//find the number of times that the object was rolled,
//and output the number of rolls
cout << "Number of Rolls: " << d.getNumRolls() <<endl;
}

geez that was simple took me 3 hours to figure it out..