Trying to code a blackjack simulator. just kinda practicing with this code to get a handle on what Im going to have to do, but i keep getting errors about the "%" operand and an uninitialized varible for playerRankOne.
Code:#include <iostream> #include <cstdlib> using namespace std; int randmax (int); int main() {//main int handCount = 0; int cardMax = 13; int suit = 4; int playerRankOne; cout << "=========================================" << endl; cout << " Welcome to the Blackjack Simulator " << endl; cout << "=========================================" << endl; cout << "Hand 1" << endl; while (handCount < 21) {//while loop til 20 hands randmax (playerRankOne);// get random # playerRankOne % cardMax;// make random # 1-13 switch (playerRankOne) {// print Ace King Queen or Jack for the values 1, 13, 12, 11 case 1 : cout << 'A' << endl; case 11 : cout << 'J' << endl; case 12 : cout << 'Q' << endl; case 13 : cout << 'K' << endl; default : cout << playerRankOne << endl; // or the number if not AKQJ }// end switch for AKQJ handCount++; cout << "Hand " << handCount << endl; }//end while loop return 0; }//main int randmax (int max) { /* randmax */ static int seed = 2; seed = (seed * 13077 + 6925) % 32768; return (static_cast<int> (max * seed / 32768.0 + 1.0)); } /* randmax */