import java.util.Scanner; public class Poker { public static String getName( int card ) { //TODO: Complete getName() so that it returns the appropriate card name } public static boolean three( int card1, int card2, int card3 ) { //TODO: Complete three() so that it returns true if all three cards have the same rank and false otherwise } public static boolean two( int card1, int card2, int card3 ) { //TODO: Complete two() so that it returns true if at least two of the three cards have the same rank and false otherwise } public static boolean flush( int card1, int card2, int card3 ) { //TODO: Complete flush() so that it returns true if all three cards have the same suit and false otherwise } public static void main(String[] args) { int[] cards = new int[3]; cards[0] = (int)(Math.random() * 52); do { cards[1] = (int)(Math.random() * 52); } while( cards[1] == cards[0] ); do { cards[2] = (int)(Math.random() * 52); } while( cards[2] == cards[1] || cards[2] == cards[0] ); System.out.println("Your three cards are:"); for( int i = 0; i < cards.length; ++i ) System.out.println( getName( cards[i] ) ); if( three( cards[0], cards[1], cards[2] ) ) System.out.println("Three of a kind!"); else if( flush( cards[0], cards[1], cards[2] ) ) System.out.println("Flush!"); else if( two( cards[0], cards[1], cards[2] ) ) System.out.println("Pair!"); else System.out.println("High card!"); } }