// implementation for class aCoin #include #include #include #include \"aCoin.h\
ID: 3619461 • Letter: #
Question
// implementation for class aCoin
#include
#include
#include
#include "aCoin.h"
#include "aRandomNumberGenerator.h"
using namespace std;
// constructor
aCoin::aCoin(aRandomNumberGenerator &number) //int s,
: seed(s) // initialize seed
{
//seed(s);
}
// destructor
aCoin::~aCoin()
{
}
// takes an integer argument and seeds the random number generator
void aCoin::seed(int s)
{
seed = s;
}
// receives a input from the user which is used to set the seed
int aCoin::inputSeed()
{
return seed;
}
// flips a coin and returns 0 or 1 (heads or tails)
int aCoin:: flip()
{
face = 1 + rand() % 6; // random numbers in range of 1 to 6
return face;
// implementation for class aDie
#include
#include
#include
#include "aDie.h"
#include "aRandomNumberGenerator.h"
using namespace std;
// constructor
aDie::aDie()
{
}
// destructor
aDie::~aDie()
{
}
// rolls the die 6,000 times and returns frequency of each face
aDie::int roll()
{
side = rand() % 2; // results in 0 or 1 (odd/even)
return side;
}
// receives a input from the user which is used to set the seed
aDie::int inputSeed()
{
}
// takes an integer argument and seeds the random number generator
aDie::void seed(int)
{
}
Explanation / Answer
can you rephrase your question again as it is difficult to read so bit difficult to understand too. I would be very thankful to you if you ask questions in clear ways.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.