Hi, I'm having trouble with one last part of finishing my basic level C++ class.
The program requires you to enter your 3 cards so that it can program the total of the cards.
Everything seems to be in order so far, but I do not know how to set the values of the face cards- J, Q, K to 10, and A to 1.
Once I do that, I'm not sure if my line
if (sum<=11||x==1||y==1||z==1)
will work appropriately.
edit::I'm pretty sure that it doesn't work right now
/*CSC215-03
* Lab 3 Program 2
* 9/25/08
* Blackjack program
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cmath>
int main(int argc, char *argv[])
{
int sum(0), x, y, z, J(0), Q(10), K(10), A(1);
cout << "Please enter your first card: ";
cin >>x;
cout << "Please enter your second card: ";
cin >>y;
cout << "Please enter your third card: ";
cin >>z;
sum=x+y+z;
if (sum<=11||x==1||y==1||z==1)
sum==sum+10;
cout << "Your total is "<<sum<<".";
if (sum > 21)
cout << " Bust!";
system ("pause");
return 0;
}