// file: testCard.java in Lab 14 ==> PlayingCards ==> testing // Short program to test the Card class // It simply creates all of the standard cards in a deck and prints them out // all ranks for a suit on individual lines. // Written by Dr. Van Cleave, 11/27/11 package testing; import storage.Card; import acm.program.*; public class testCard extends DialogProgram { public void run() { // Create a deck of cards, running through all the ranks (1 - 13) in each of // the four suits, then display the new card // Output will be in 4 lines, one for each of the suits, with all ranks // from ace to King showing in that order // Lines should follow the order: Hearts, Clubs, Diamonds, then Spades for (int suits = 1; suits <= NUMSUITS; suits++) { for (int ranks = 1; ranks <= NUMRANKS; ranks++){ Card theCard = new Card(suits, ranks, true); print(theCard + " "); } print("\n"); // done with the suit } println(); // finished creating and displaying all the cards } // Constant declaration section private static final int NUMSUITS = 4; // Hearts, Clubs, Diamonds, Spades private static final int NUMRANKS = 13; // Ace, 2-10, Jack, Queen, King public static void main(String args[]) { (new testCard()).start(); } }