//Chapter 4, Problem 22, with switch #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 switch (rank) { case 1: cout << "Ace"; break; case 2: cout << "Two"; break; case 3: cout << "Three"; break; case 4: cout << "Four"; break; //the rest case 12: cout << "Queen"; break; case 13: cout << "King"; break; } //print the suit cout << " of "; switch (suit) { case 'C': cout << "Clubs\n"; break; case 'H': cout << "Hearts\n"; break; case 'D': cout << "Diamonds\n"; break; case 'S': cout << "Spades\n"; break; } return 0; }