public class Card {

    /*------------------------------------------------------
      declare global constants
      ----------------------------------------------------*/
    public static final int CLUBS    = 0;
    public static final int DIAMONDS = 1;
    public static final int HEARTS   = 2;
    public static final int SPADES   = 3;

    /*------------------------------------------------------
      declare global variables
      ----------------------------------------------------*/
    private int index;
    // 0..51

    private int suit;
    //  0..12 => clubs,    suit=0
    // 13..25 => diamonds, suit=1
    // 26..38 => hearts,   suit=2
    // 39..51 => spades,   suit=3

    private int value;
    // value: 0 1 2 3 4 5 6 7 8 9 10 11 12 
    // face : 2 3 4 5 6 7 8 9 T J  Q  K  A
    // where T = ten, J = jack, Q = queen, K = king, A = ace


    /*------------------------------------------------------
      constructs a new Card instance
      ----------------------------------------------------*/
    public Card ( int index0 ) {
	setIndex( index0 );
    } // end of Card constructor


    /*------------------------------------------------------
      sets this card's index, corresponding suit and value
      ----------------------------------------------------*/
    public void setIndex( int index0 ) {
	index = index0;
	suit  = index / 13;
	value = index % 13;
    } // end of setIndex()


    /*------------------------------------------------------
      returns this card's index as an int
      ----------------------------------------------------*/
    public int getIndex() {
	return index;
    } // end of getIndex()


    /*------------------------------------------------------
      returns this card's value as an int
      ----------------------------------------------------*/
    public int getValue() {
	return value;
    } // end of getValue()


    /*------------------------------------------------------
      returns this card's value as a char
      ----------------------------------------------------*/
    public char getValueChar() {
	char y = ' ';
	switch( value ) {
	case  8: y = 'T'; break;
	case  9: y = 'J'; break;
	case 10: y = 'Q'; break;
	case 11: y = 'K'; break;
	case 12: y = 'A'; break;
	default: y = (char)( '0' + value+2 );
	} // end of switch
	return y;
    } // end of getValueChar();


    /*------------------------------------------------------
      returns this card's suit as an int
      ----------------------------------------------------*/
    public int getSuit() {
	return suit;
    } // end of getSuit()


    /*------------------------------------------------------
      returns this card's suit as a char
      ----------------------------------------------------*/
    public char getSuitChar() {
	char y = ' ';
	switch( suit ) {
	case CLUBS:    y = 'C'; break;
	case DIAMONDS: y = 'D'; break;
	case HEARTS:   y = 'H'; break;
	case SPADES:   y = 'S'; break;
	} // end of switch
	return y;
    } // end of getSuitChar()


    /*------------------------------------------------------
      returns this card as a String
      e.g., the four of hearts = "4H"
      ----------------------------------------------------*/
    public String toString() {
	String s = new String();
	s += getValueChar();
	s += getSuitChar();
	return s;
    } // end of toString()


    /*------------------------------------------------------
      (1) write a method that returns the score of this card,
      according to the following table:

      card face	value | score
      ----------------+------
       2..10          | 2..10
       J, Q, K        | 10
       A              | 1 or 11

      ----------------------------------------------------*/
    public int getScore() {

    } // end of getScore()



    /*------------------------------------------------------
      (2) write a method that returns true if the card is 
      an Ace
      ----------------------------------------------------*/
    public boolean isAce() {

    } // end of isAce()


} // end of Card class
