//******************************************************************** // Card.java Author: Kelly Debure // // Represents one card with a suit and face value // //******************************************************************** public class Card { private final int MAXVALUE = 13; private char suit; private int faceValue; // current value showing on the die //----------------------------------------------------------------- // Constructor: Sets the initial card value and suit. //----------------------------------------------------------------- public Card() { faceValue = (int)(Math.random() * MAXVALUE) + 1; // assign a value 1 to 13 int suitVal = (int)(Math.random() * 4); // generate value 0 to 3 if (suitVal == 0) suit = 'C'; // map suitVal into a suit else if (suitVal == 1) suit = 'D'; else if (suitVal == 2) suit = 'H'; else suit = 'S'; } }