// Name: // Student Id: // Electronic Id: // Lab section: // Course section: // Laboratory instructor: // Date: // Honor pledge: // program: plays a user-specified number of rounds of the game Ace-High #include #include #include using namespace std; // prototype of get_card() int get_card(); // returns a random integer in the range 2 ,, 11 void set_seed(); // generates a different seed for the random number generator // main(): application entry point int main() { const bool DEBUG = true; if (! DEBUG ) { // DEBUG is false, we generate a different random number sequence // otherwise, we use the same one each time set_seed(); } // YOUR CODE GOES HERE // while player wants to continue to play // give player two cards // did dealer automatically win? // yes, announce it // instead // give dealer two cards // did player win? // announce it // instead did dealer win? // announce it // instead was it a tie? // while draw cards are the same // give player card // give dealer card // did player win? // announce it // instead it must be that dealer won // announce it // does play want to play again? return 0; } // get_card(): returns a random integer in the range 2 ,, 11 int get_card() { const int Low = 2; const int High = 11; int IntervalSize = High - Low + 1; int RandomOffset = rand() % IntervalSize; return Low + RandomOffset; } // set_seed(): generates a different seed for the random number generator void set_seed() { srand((unsigned int) time(0)); }