/** * This is a Card class. * We assume that a card is represented as a * number from 0 to 51. * The suits are in order: Diamonds, Hearts, Clubs, Spades * And the face cards are in the order: Ace, 2, 3, ...., 10, Jack, Queen, King */ public class CardNames { public static void main(String[] args) { // Pick a card: int card = (int) (52*Math.random()); // Determine its suit and face index int suit = card/13; int face = card % 13; // This is used for debugging: System.out.println("The card you picked is #"+card); System.out.println("The suit is #"+suit); System.out.println("The face is #"+face); // Print out the name of the card, e.g. Ace of Spades String suitName = ""; String faceName = ""; // YOUR CODE GOES HERE System.out.println("Your card is: " + faceName + " of " + suitName); } }