// file: ex1.cpp
// by: Dawn Lawrie
// date: June 9, 2004

// modified by:

// Program prompts the user for the attributs of a playing card (rank and suit)
// and prints details about the card

#include <iostream>
using std::cout;
using std::cin;
using std::endl;

// Codes for suits
const int SPADES = 0;
const int HEARTS = 1; 
const int DIAMONDS = 2;
const int CLUBS = 3;

// Codes for nonnumeric ranks
const int ACE = 1;
const int JACK = 11;
const int QUEEN = 12;
const int KING = 13;

int main() {

  int rank, suit;

  // User selects a card
  cout << "What is the rank of your card?" << endl
       << "\t1 for Ace" << endl
       << "\t2-10 for numbered cards" << endl
       << "\t11 for Jack" << endl
       << "\t12 for Queen" << endl
       << "\t13 for King" << endl;
  cin >> rank;
  cout << "What is the suit of your card?" << endl
       << "\t0 for Spades" << endl
       << "\t1 for Hearts" << endl
       << "\t2 for Diamonds" << endl
       << "\t3 for Clubs" << endl;
  cin >> suit;

  // Write an if-statement that determines if the card is a face card
  // If it is, print out "This card is a face card."
  // If it is not, print out "This card is not a face card."

  // Your code goes here!

  // Write an if-statement that determines the color of the card
  // If it is red, print out "This card is red."
  // If it is black, print out "This card is black."

  // Your code goes here!

  // Print out the name of the card if the form "rank of suit" 
  // using a switch statement

  // Outputs the rank
  switch (rank)
    {
    case JACK:
      cout << "Jack";
      break;
    case QUEEN:
      cout << "Queen";
      break;
    case KING:
      cout << "King";
      break;
    case ACE:
      cout << "Ace";
      break;
    default:
      cout << rank;
    }

  // Outputs the "of"
  cout << " of ";

  // Outputs the suit
  // Your code goes here!

  return 0;

}
 
