Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When I build my code I get these warnings: warning C4309: \'=\' : truncation of

ID: 3639950 • Letter: W

Question

When I build my code I get these warnings:
warning C4309: '=' : truncation of constant value
warning C4101: 'iSuit' : unreferenced local variable
warning C4101: 'k' : unreferenced local variable
warning C4101: 'iCard' : unreferenced local variable
warning C4101: 'm' : unreferenced local variable
warning C4101: 'iPlayerCount' : unreferenced local variable

I need help to clean my build:

#include <iostream>
#include <iomanip>
#include <string.h>
#include <windows.h>

using namespace std;




/*
This function takes as input card number and returns the score associated with the number
*/
int getCardScore(char number)
{
int score = 0;

switch (number)
{
case '2':
score =2;
break;
case '3':
score = 3;
break;
case '4':
score =4;
break;
case '5':
score =5;
break;
case '6':
score =6;
break;
case '7':
score =7;
break;
case '8':
score =8;
break;
case '9':
score =9;
break;
case '0':
score =10;
break;
case 'J':
score =10;
break;
case 'Q':
score =10;
break;
case 'K':
score =10;
break;
case 'A':
score =1; //score for Aces is returned 1 . The value 11 or 1 is decided during score calculation.
break;
}


return score;
}


/*
This function takes Suit number and returns appropriate suite shape
*/
char getCardSuit(int Suit)
{
char cSuit;

switch (Suit)
{
case 0:
cSuit=char(4);
break;
case 1:
cSuit=char(3);
break;
case 2:
cSuit=char(5);
break;
case 3:
cSuit=char(6);
break;
}

return cSuit;
}

/*
this function takes card suit and number as inputs and returns complete card face and value
*/
char* getCardValue(int Suit, int number)
{
char *cardValue= new char[2];

switch (number)
{
case 0:
cardValue[0]='2';
break;
case 1:
cardValue[0]='3';
break;
case 2:
cardValue[0]='4';
break;
case 3:
cardValue[0]='5';
break;
case 4:
cardValue[0]='6';
break;
case 5:
cardValue[0]='7';
break;
case 6:
cardValue[0]='8';
break;
case 7:
cardValue[0]='9';
break;
case 8:
cardValue[0]='10';
break;
case 9:
cardValue[0]='J';
break;
case 10:
cardValue[0]='Q';
break;
case 11:
cardValue[0]='K';
break;
case 12:
cardValue[0]='A';
break;
}

switch (Suit)
{
case 0:
cardValue[1]=char(4);
break;
case 1:
cardValue[1]=char(3);
break;
case 2:
cardValue[1]=char(5);
break;
case 3:
cardValue[1]=char(6);
break;
}


return cardValue;
}

/*
This function calculates score based on the current card and number of aces
*/
int calculateScore(int score,int acesCount, char iCard)
{
int iScore=0;

iScore = getCardScore(iCard); //Gets the card score


if(iScore+score == 21) //Checks if score equals 21
return 21;
//Checks if there are aces then
//see if 11 value for ace can win the player
else if (iScore +10+score == 21 && acesCount>=1)
return 21;
else
return iScore+score; //otherwise returns the score

}

/*
This function displays game after every draw
*/

void displayGame(char cGameCard[5][5][2], int iNumberOfPlayers, int iNumberOfDraws)
{

cout<<" ********************************************* ";
cout<<" Dealer Player1 Player2 Player3 Player4 ";
for (int i=0;i<5;++i)
{
cout<<"Card"<<i+1<<" ";
for (int j=0;j<=iNumberOfPlayers;++j)
{
if(i<=iNumberOfDraws+1)
{
if(j==0 && i==0) //It does not print the dealers first card
cout<<"? ";
else
{
if(cGameCard[j][i][0] == 'H')
cout<<"Hold "; //Print "Hold" if the player is on hold
else if(cGameCard[j][i][0] == '0')
cout<<"10"<<cGameCard[j][i][1]<<" ";
else
cout<<cGameCard[j][i][0]<<cGameCard[j][i][1]<<" ";
}

}

}
cout<<" ";
}
cout<<" ********************************************* ";
}

/*
this function is called at the end of game to display the results as well
*/
void displayGame(char cGameCard[5][5][2], int iNumberOfPlayers, int iNumberOfDraws,bool gameEnd,int scoreCard[5],char* GameResult[5])
{

cout<<" ********************************************* ";
cout<<" Dealer Player1 Player2 Player3 Player4 ";
for (int i=0;i<5;++i)
{
cout<<"Card"<<i+1<<" ";
for (int j=0;j<=iNumberOfPlayers;++j)
{
if(i<=iNumberOfDraws+1)
{
if(j==0 && !gameEnd && i==0)
cout<<"? ";
else
{
if(cGameCard[j][i][0] == 'H')
cout<<"Hold ";
else if(cGameCard[j][i][0] == '0')
cout<<"10"<<cGameCard[j][i][1]<<" ";
else
cout<<cGameCard[j][i][0]<<cGameCard[j][i][1]<<" ";
}

}

}
cout<<" ";
}

//The following loop prints the score of each player
cout<<"Final: ";

for(int i=0;i<=iNumberOfPlayers;++i)
{
cout<<scoreCard[i]<<" ";
}

cout<<" ";

//the following loop prints the result of each player
for(int i=0;i<=iNumberOfPlayers;++i)
{
cout<<GameResult[i]<<" ";
}
cout<<" ********************************************* ";
}



/*
this function displays card deck
*/
void displayCardDeck(char cCardDeck[4][13])
{
cout<<" ***************Card Deck**************************** ";
cout<<" 2 3 4 5 6 7 8 9 10 J Q K A ";

for(int i=0;i<4;++i)
{
cout<<getCardSuit(i)<<" ";
for(int j=0;j<13;++j)
{
cout<<cCardDeck[i][j]<<" ";
}
cout<<endl;
}
cout<<" ***************Card Deck**************************** ";

}

//this function is used to draw a card for the player

char* drawCard(char cCardDeck[4][13],int iPlayer)
{
char * chr = new char[2];
int iSuit = rand()%4;
int iCard = rand()%13;

while(cCardDeck[iSuit][iCard] != ' ') //checks if the card is not occupied by other player
{
//uses a random number generator to pick suite and number
iSuit = rand() %4;
iCard= rand() % 13;
}

cCardDeck[iSuit][iCard] = iPlayer+48;
chr = getCardValue(iSuit,iCard);
return chr;


}

//Checks if any player wins or all are busted
bool checkGameEnd(int ScoreCard[5])
{
bool allPlayersBusted = true;
for(int i=0;i<5;++i)
{
if(ScoreCard[i] <= 21)
allPlayersBusted = false;
if(ScoreCard[i] == 21)
return true;


}
if(allPlayersBusted)
return true;
return false;

}
void main (void)
{
bool bPlayerDraw[5]; //Boolean to determine if player holds (F)
//or draws card (T)
char cPlay = 'N'; //Character variable for play game input
char cCardDeck[4][13]; //Character array representing the card deck
int iCard; //Card array index
//0 = 2 card
//1 = 3 card
//2 = 4 card
//3 = 5 card
//4 = 6 card
//5 = 7 card
//6 = 8 card
//7 = 9 card
//8 = 10 card
//9 = jack card
//10 = queen card
//11 = king card
//12 = ace card
int iNumberOfDraws = 0; //Number of rounds of card draws
int iSuit; //Suit array index
//0 = diamonds
//1 = hearts
//2 = clubs
//3 = spades
// ASCII character display reference for display card suit symbols
//3 = heart symbol
//4 = diamond symbol
//5 = club symbol
//6 = spade symbol
int iNumberOfPlayers = 0;//Number of players in current game
int iPlayerCount[5]; //Integer array to holder each player's count
//iPlayer[0] is always the dealer
int iHighestCount = 0; //Highest count for a single game
int k, m; //integer loop counters
srand(GetTickCount()); //Seed the random-number generator



//Main game loop

cout<<"Do you want to play the game of Blackjack?(Y for yes and N for No):";
cin>>cPlay;


while(cPlay == 'Y' || cPlay == 'y')
{
//Initialize Card Deck array with "Space"
for (int i =0; i <4; ++i)
for (int j = 0; j<13; ++j)
cCardDeck[i][j] = ' ';


char GameCard[5][5][2]={' '};
int ScoreCard[5]={0};
int acesCount[5] = {0};
char* GameResult[5] = {"Play","Play","Play","Play","Play"}; //Initializes the array with Play.

cout<<"Welcome to Honest Sam's Blackjack Table"<<endl<<"Glad to have you back!"<<endl;
cout<<"Enter the number of players in the game."<<endl;
cout<<"There must be at least one player but no more than four."<<endl;
cout<<"Number of players:";
cin>>iNumberOfPlayers; //get number of players from the user

while(iNumberOfPlayers <1 || iNumberOfPlayers>4)
{
cout<<"There must be at least one player but no more than four."<<endl;
cout<<"Number of players:";
cin>>iNumberOfPlayers;
}

for(int i=0;i<5;++i)
bPlayerDraw[i]=true;

int iNumberOfDealerDraws = rand()%4; //use a random number to determine dealer draws
char * chr = new char[2];
bool gameEnd = false;

for (int i=0; i<=iNumberOfPlayers; ++i)
{
for (int j=0; j<2; ++j) //Deal two cards for each player and the dealer
{
chr = drawCard(cCardDeck,i);
ScoreCard[i] = calculateScore(ScoreCard[i],acesCount[i],chr[0]);

if(chr[0] == 'A') //if card is an ace then increment the aces count for the player
acesCount[i]++;

GameCard[i][j][0]=chr[0];
GameCard[i][j][1]=chr[1];

if(ScoreCard[i] == 21) //if score of the player is equal to 21 then he wins
{
GameResult[i]="Win!";

}
else if(ScoreCard[i] > 21) //if score is greater than 21 then he loses
{
GameResult[i]="Lose";
}

if(checkGameEnd(ScoreCard)) //checks if any player wins or all busted
{
gameEnd =true;

}
}
cout<<endl;
}

displayGame(GameCard,iNumberOfPlayers,iNumberOfDraws); //display game board

cout<<" Dealer Draws:"<<iNumberOfDealerDraws<<endl<<endl;
int i=2;


while(i<5 && !gameEnd) //either 5 draws are done at max or game is ended with any player on 21 or all over 21
{
if(i<(iNumberOfDealerDraws +2)) //2 draws have already been made above
{
//draw card for dealer
chr = drawCard(cCardDeck,0);
GameCard[0][i][0]=chr[0];
GameCard[0][i][1]=chr[1];
ScoreCard[0] = calculateScore(ScoreCard[0],acesCount[0],chr[0]);

if(chr[0] == 'A') //checks Aces Count
acesCount[i]++;

if(ScoreCard[0] == 21)
{
GameResult[0]="Win!";

}
else if(ScoreCard[0] > 21)
{
GameResult[0]="Lose";
}

if(checkGameEnd(ScoreCard)) //Check if game ending condition occurs
{
gameEnd =true;
break;
}


}
else
{
GameCard[0][i][0]='H';
GameCard[0][i][1]='H';
}

char cDrawCard;

for(int j=0;j<iNumberOfPlayers;++j) //play for all other players
{
if(GameResult[j+1]=="Play")
{
if(bPlayerDraw[j+1]) //if player is not on hold
{
//ask the player if he wants to draw or hold
cout<<"Player"<<j+1<<":Draw(D) or Hold(any key)?";
cin>>cDrawCard;

if(cDrawCard =='D' || cDrawCard== 'd')
{
chr=drawCard(cCardDeck,j+1);
GameCard[j+1][i][0]=chr[0];
GameCard[j+1][i][1]=chr[1];
ScoreCard[j+1] = calculateScore(ScoreCard[j+1],acesCount[j+1],chr[0]);
if(chr[0] == 'A')
acesCount[j+1]++;

if(ScoreCard[j+1] == 21)
GameResult[j+1]="Win!";
else if(ScoreCard[j+1] > 21)
GameResult[j+1]="Lose";
if(checkGameEnd(ScoreCard))
{
gameEnd =true;
}

}
else
bPlayerDraw[j+1]=false;
}

if(!bPlayerDraw[j+1]) //put the player on hold
{
GameCard[j+1][i][0]='H';
GameCard[j+1][i][1]='H';
}

}
}
//display game board
displayGame(GameCard,iNumberOfPlayers,i);
i=i+1;
}

displayCardDeck(cCardDeck); //display card deck


for(int i=0;i<=iNumberOfPlayers;++i) //set Lose to all players execept the winner
{
if(GameResult[i]!="Win!")
GameResult[i]="Lose";

}

displayGame(GameCard,iNumberOfPlayers,5,true,ScoreCard,GameResult); //display final game with scores and results


//Ask the user if he wants to play again or not
cout<<" Do you want to play the game of Blackjack?(Y for yes and N for No):";
cin>>cPlay;
}
}

Explanation / Answer

please rate - thanks

I think/hope I've highlighted all the changes in red

#include <iostream>
#include <iomanip>
#include <string.h>
#include <windows.h>

using namespace std;




/*
This function takes as input card number and returns the score associated with the number
*/
int getCardScore(char number)
{
int score = 0;

switch (number)
{
case '2':
score =2;
break;
case '3':
score = 3;
break;
case '4':
score =4;
break;
case '5':
score =5;
break;
case '6':
score =6;
break;
case '7':
score =7;
break;
case '8':
score =8;
break;
case '9':
score =9;
break;
case '0':
score =10;
break;
case 'J':
score =10;
break;
case 'Q':
score =10;
break;
case 'K':
score =10;
break;
case 'A':
score =1; //score for Aces is returned 1 . The value 11 or 1 is decided during score calculation.
break;
}


return score;
}


/*
This function takes Suit number and returns appropriate suite shape
*/
char getCardSuit(int Suit)
{
char cSuit;

switch (Suit)
{
case 0:
cSuit=char(4);
break;
case 1:
cSuit=char(3);
break;
case 2:
cSuit=char(5);
break;
case 3:
cSuit=char(6);
break;
}

return cSuit;
}

/*
this function takes card suit and number as inputs and returns complete card face and value
*/
char* getCardValue(int Suit, int number)
{
char *cardValue= new char[2];

switch (number)
{
case 0:
cardValue[0]='2';
break;
case 1:
cardValue[0]='3';
break;
case 2:
cardValue[0]='4';
break;
case 3:
cardValue[0]='5';
break;
case 4:
cardValue[0]='6';
break;
case 5:
cardValue[0]='7';
break;
case 6:
cardValue[0]='8';
break;
case 7:
cardValue[0]='9';
break;
case 8:
cardValue[0]='1';
cardValue[1]='0';
break;
case 9:
cardValue[0]='J';
break;
case 10:
cardValue[0]='Q';
break;
case 11:
cardValue[0]='K';
break;
case 12:
cardValue[0]='A';
break;
}

switch (Suit)
{
case 0:
cardValue[1]=char(4);
break;
case 1:
cardValue[1]=char(3);
break;
case 2:
cardValue[1]=char(5);
break;
case 3:
cardValue[1]=char(6);
break;
}


return cardValue;
}

/*
This function calculates score based on the current card and number of aces
*/
int calculateScore(int score,int acesCount, char iCard)
{
int iScore=0;

iScore = getCardScore(iCard); //Gets the card score


if(iScore+score == 21) //Checks if score equals 21
return 21;
//Checks if there are aces then
//see if 11 value for ace can win the player
else if (iScore +10+score == 21 && acesCount>=1)
return 21;
else
return iScore+score; //otherwise returns the score

}

/*
This function displays game after every draw
*/

void displayGame(char cGameCard[5][5][2], int iNumberOfPlayers, int iNumberOfDraws)
{

cout<<" ********************************************* ";
cout<<" Dealer Player1 Player2 Player3 Player4 ";
for (int i=0;i<5;++i)
{
cout<<"Card"<<i+1<<" ";
for (int j=0;j<=iNumberOfPlayers;++j)
{
if(i<=iNumberOfDraws+1)
{
if(j==0 && i==0) //It does not print the dealers first card
cout<<"? ";
else
{
if(cGameCard[j][i][0] == 'H')
cout<<"Hold "; //Print "Hold" if the player is on hold
else if(cGameCard[j][i][0] == '0')
cout<<"10"<<cGameCard[j][i][1]<<" ";
else
cout<<cGameCard[j][i][0]<<cGameCard[j][i][1]<<" ";
}

}

}
cout<<" ";
}
cout<<" ********************************************* ";
}

/*
this function is called at the end of game to display the results as well
*/
void displayGame(char cGameCard[5][5][2], int iNumberOfPlayers, int iNumberOfDraws,bool gameEnd,int scoreCard[5],char* GameResult[5])
{

cout<<" ********************************************* ";
cout<<" Dealer Player1 Player2 Player3 Player4 ";
for (int i=0;i<5;++i)
{
cout<<"Card"<<i+1<<" ";
for (int j=0;j<=iNumberOfPlayers;++j)
{
if(i<=iNumberOfDraws+1)
{
if(j==0 && !gameEnd && i==0)
cout<<"? ";
else
{
if(cGameCard[j][i][0] == 'H')
cout<<"Hold ";
else if(cGameCard[j][i][0] == '0')
cout<<"10"<<cGameCard[j][i][1]<<" ";
else
cout<<cGameCard[j][i][0]<<cGameCard[j][i][1]<<" ";
}

}

}
cout<<" ";
}

//The following loop prints the score of each player
cout<<"Final: ";

for(int i=0;i<=iNumberOfPlayers;++i)
{
cout<<scoreCard[i]<<" ";
}

cout<<" ";

//the following loop prints the result of each player
for(int i=0;i<=iNumberOfPlayers;++i)
{
cout<<GameResult[i]<<" ";
}
cout<<" ********************************************* ";
}



/*
this function displays card deck
*/
void displayCardDeck(char cCardDeck[4][13])
{
cout<<" ***************Card Deck**************************** ";
cout<<" 2 3 4 5 6 7 8 9 10 J Q K A ";

for(int i=0;i<4;++i)
{
cout<<getCardSuit(i)<<" ";
for(int j=0;j<13;++j)
{
cout<<cCardDeck[i][j]<<" ";
}
cout<<endl;
}
cout<<" ***************Card Deck**************************** ";

}

//this function is used to draw a card for the player

char* drawCard(char cCardDeck[4][13],int iPlayer)
{
char * chr = new char[2];
int iSuit = rand()%4;
int iCard = rand()%13;

while(cCardDeck[iSuit][iCard] != ' ') //checks if the card is not occupied by other player
{
//uses a random number generator to pick suite and number
iSuit = rand() %4;
iCard= rand() % 13;
}

cCardDeck[iSuit][iCard] = iPlayer+48;
chr = getCardValue(iSuit,iCard);
return chr;


}

//Checks if any player wins or all are busted
bool checkGameEnd(int ScoreCard[5])
{
bool allPlayersBusted = true;
for(int i=0;i<5;++i)
{
if(ScoreCard[i] <= 21)
allPlayersBusted = false;
if(ScoreCard[i] == 21)
return true;


}
if(allPlayersBusted)
return true;
return false;

}
void main (void)
{
bool bPlayerDraw[5]; //Boolean to determine if player holds (F)
//or draws card (T)
char cPlay = 'N'; //Character variable for play game input
char cCardDeck[4][13]; //Character array representing the card deck
//int iCard; //Card array index
//0 = 2 card
//1 = 3 card
//2 = 4 card
//3 = 5 card
//4 = 6 card
//5 = 7 card
//6 = 8 card
//7 = 9 card
//8 = 10 card
//9 = jack card
//10 = queen card
//11 = king card
//12 = ace card
int iNumberOfDraws = 0; //Number of rounds of card draws
//int iSuit; //Suit array index
//0 = diamonds
//1 = hearts
//2 = clubs
//3 = spades
// ASCII character display reference for display card suit symbols
//3 = heart symbol
//4 = diamond symbol
//5 = club symbol
//6 = spade symbol
int iNumberOfPlayers = 0;//Number of players in current game
//int iPlayerCount[5]; //Integer array to holder each player's count
//iPlayer[0] is always the dealer
int iHighestCount = 0; //Highest count for a single game
//int m; //integer loop counters
srand(GetTickCount()); //Seed the random-number generator



//Main game loop

cout<<"Do you want to play the game of Blackjack?(Y for yes and N for No):";
cin>>cPlay;


while(cPlay == 'Y' || cPlay == 'y')
{
//Initialize Card Deck array with "Space"
for (int i =0; i <4; ++i)
for (int j = 0; j<13; ++j)
cCardDeck[i][j] = ' ';


char GameCard[5][5][2]={' '};
int ScoreCard[5]={0};
int acesCount[5] = {0};
char* GameResult[5] = {"Play","Play","Play","Play","Play"}; //Initializes the array with Play.

cout<<"Welcome to Honest Sam's Blackjack Table"<<endl<<"Glad to have you back!"<<endl;
cout<<"Enter the number of players in the game."<<endl;
cout<<"There must be at least one player but no more than four."<<endl;
cout<<"Number of players:";
cin>>iNumberOfPlayers; //get number of players from the user

while(iNumberOfPlayers <1 || iNumberOfPlayers>4)
{
cout<<"There must be at least one player but no more than four."<<endl;
cout<<"Number of players:";
cin>>iNumberOfPlayers;
}

for(int i=0;i<5;++i)
bPlayerDraw[i]=true;

int iNumberOfDealerDraws = rand()%4; //use a random number to determine dealer draws
char * chr = new char[2];
bool gameEnd = false;

for (int i=0; i<=iNumberOfPlayers; ++i)
{
for (int j=0; j<2; ++j) //Deal two cards for each player and the dealer
{
chr = drawCard(cCardDeck,i);
ScoreCard[i] = calculateScore(ScoreCard[i],acesCount[i],chr[0]);

if(chr[0] == 'A') //if card is an ace then increment the aces count for the player
acesCount[i]++;

GameCard[i][j][0]=chr[0];
GameCard[i][j][1]=chr[1];

if(ScoreCard[i] == 21) //if score of the player is equal to 21 then he wins
{
GameResult[i]="Win!";

}
else if(ScoreCard[i] > 21) //if score is greater than 21 then he loses
{
GameResult[i]="Lose";
}

if(checkGameEnd(ScoreCard)) //checks if any player wins or all busted
{
gameEnd =true;

}
}
cout<<endl;
}

displayGame(GameCard,iNumberOfPlayers,iNumberOfDraws); //display game board

cout<<" Dealer Draws:"<<iNumberOfDealerDraws<<endl<<endl;
int i=2;


while(i<5 && !gameEnd) //either 5 draws are done at max or game is ended with any player on 21 or all over 21
{
if(i<(iNumberOfDealerDraws +2)) //2 draws have already been made above
{
//draw card for dealer
chr = drawCard(cCardDeck,0);
GameCard[0][i][0]=chr[0];
GameCard[0][i][1]=chr[1];
ScoreCard[0] = calculateScore(ScoreCard[0],acesCount[0],chr[0]);

if(chr[0] == 'A') //checks Aces Count
acesCount[i]++;

if(ScoreCard[0] == 21)
{
GameResult[0]="Win!";

}
else if(ScoreCard[0] > 21)
{
GameResult[0]="Lose";
}

if(checkGameEnd(ScoreCard)) //Check if game ending condition occurs
{
gameEnd =true;
break;
}


}
else
{
GameCard[0][i][0]='H';
GameCard[0][i][1]='H';
}

char cDrawCard;

for(int j=0;j<iNumberOfPlayers;++j) //play for all other players
{
if(GameResult[j+1]=="Play")
{
if(bPlayerDraw[j+1]) //if player is not on hold
{
//ask the player if he wants to draw or hold
cout<<"Player"<<j+1<<":Draw(D) or Hold(any key)?";
cin>>cDrawCard;

if(cDrawCard =='D' || cDrawCard== 'd')
{
chr=drawCard(cCardDeck,j+1);
GameCard[j+1][i][0]=chr[0];
GameCard[j+1][i][1]=chr[1];
ScoreCard[j+1] = calculateScore(ScoreCard[j+1],acesCount[j+1],chr[0]);
if(chr[0] == 'A')
acesCount[j+1]++;

if(ScoreCard[j+1] == 21)
GameResult[j+1]="Win!";
else if(ScoreCard[j+1] > 21)
GameResult[j+1]="Lose";
if(checkGameEnd(ScoreCard))
{
gameEnd =true;
}

}
else
bPlayerDraw[j+1]=false;
}

if(!bPlayerDraw[j+1]) //put the player on hold
{
GameCard[j+1][i][0]='H';
GameCard[j+1][i][1]='H';
}

}
}
//display game board
displayGame(GameCard,iNumberOfPlayers,i);
i=i+1;
}

displayCardDeck(cCardDeck); //display card deck


for(int i=0;i<=iNumberOfPlayers;++i) //set Lose to all players execept the winner
{
if(GameResult[i]!="Win!")
GameResult[i]="Lose";

}

displayGame(GameCard,iNumberOfPlayers,5,true,ScoreCard,GameResult); //display final game with scores and results


//Ask the user if he wants to play again or not
cout<<" Do you want to play the game of Blackjack?(Y for yes and N for No):";
cin>>cPlay;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote