/* *Com S 207 *Hw 5 *PlayCard.java */ public class PlayCard{ /** * This program deals 5 random cards from a deck */ public static void main(String[] args) { Card[] series = new Card[5]; boolean repeating; // First deal 5 cards for(int i = 0; i < 5; i++) { // stay in this do-loop until the new card // is different from all previously dealt cards do { repeating=false; series[i] = new Card(); for(int j=0; j< i; j++) { if(series[i].equal(series[j])) repeating=true; } } while(repeating); } // Print the 5 cards for(int j = 0; j < 5; j++){ System.out.println(series[j]); } } }