Question 1a #include #include #include using namespace std; int main(){ int r, i; srand(time(NULL)); for(___){ r=___; cout << r << "\t"; } cout << endl; return 0; } Question 1b #include #include #include using namespace std; int main(){ int r, i; srand(time(NULL)); for(___){ // print \n if 10 numbers are printed // generate a random number and print it out } cout << endl; return 0; } Question 2 #include #include #include using namespace std; int main(){ int r1, r2, i; // initialize random number generator // generate first random number r1 // generate second random number r2 (use do-while to make sure r2 != r1) cout << "the random numbers are "<< r1 <<" and " << r2 << endl; return 0; } Question 3 #include #include #include using namespace std; int main(){ int balance=100, invest, guess, d1, d2, d3, outcome; cout << "Let's start to play the game with 3 dices" << endl; cout << "Your balance = " << balance << endl; do{ // input invest (make sure invest > balance) // input guess (accept only 0 or 1) // generate three random number between 1-6 for d1, d2, and d3 cout << "The points of the 3 dices are " << d1 << " " << d2 << " " << d3 << endl; // check and assign the result to outcome (1=big, 0 = small) // compare outcome and guess, print out result printf("Your balance = $%d\n",balance); }while(__); // end game when balance <= 0 return 0; }