1. #include "randgen.h" #include void main (void) { RandGen rand; for (int x = 0;x < 6;x++) { cout << "Roll " << x << " : " << rand.RandInt(1,6) << "\n"; } } 2. 2 different random numbers are generated, one for testing for red, and another for testing for white and blue. The program should use only one random number by setting a variable equal to randomVals.RandInt(3) and then testing with that. 3. Missing code : int (r*2) 4. #include "randgen.h" #include int main() { RandGen randomVals; int position = 0; int maxpos = 0; int minpos = 0; int numSteps; int step; int flip; cout << "Number of steps? "; cin >> numSteps; for (step = 0; step < numSteps; step++) { flip = randomVals.RandInt(2); if (flip == 0) { position++; if (position > maxpos) maxpos = position; } else { position--; if (position < minpos) minpos = position; } } cout << "Final position = " << position << endl; cout << "Maximum position = " << maxpos << endl; cout << "Minimum position = " << minpos << endl; return 0; }