//Chapter 4, Problem 22, with if #include using namespace std; int main () { int rank; char suit; cout << "What is the suit (C, D, H, S): "; cin >> suit; cout << "What is the rank (1-13): "; cin >> rank; //print the rank if (rank==1) cout << "Ace"; else if (rank==2) cout << "Two"; else if (rank=3) cout << "Three"; else if (rank==4) cout << "Four"; //the rest else if (rank==12) cout << "Queen"; else if (rank==13) cout << "King"; //print the suit cout << " of "; if (suit == 'C') cout << "Clubs\n"; else if (suit == 'H') cout << "Hearts\n"; else if (suit == 'D') cout << "Diamonds\n"; else if (suit == 'S') cout << "Spades\n"; return 0; }