SECTION II: FREE RESPONSE 4. Part (a) Position RandomPosition(const Environment & env) // postcondition: A random position (row, col) with // 0 <= row < env.NumRows() // 0 <= col < env.NumCols() is returned { RandGen randomVals; int row = randomVals.RandInt(env.NumRows()); int col = randomVals.RandInt(env.NumCols()); return Position(row, col); } Part (b) bool Simulation::CreateFish (Environment & env) // postcondition: If a random empty position in env is found // in five or fewer attempts, then a new fish // is added at that position and true is // returned; otherwise false is returned { int try; Position pos; for (try = 1; try <= 5; try++) { pos = RandomPosition(env); if (env.IsEmpty(pos)) { env.AddFish(pos); return true; } } return false; }