UGH1: The use of Array

Please finish the checkRank method. The checkRank method will return the card with the highest rank. Rank is determined by looking at value as well as suits (clubs < diamonds < hearts < spades). For example, King of Spades > King of Clubs and 10 of Clubs > 5 of Spades (value is the first determinant)

public class TestArray {
  public Card checkRank(Card cardarray[]) {


  } // checkRank

  public void run() {
   int maxCards = 5
   Card myCards[] = new Card[maxCards];
   System.out.print("Cards are:");
   for (int j = 0; j < maxCards; j++) {
     myCards[j] = deck.draw();
     System.out.print(myCards[j]);
   }
   System.out.println("\nCard with the highest Rank:" + checkRank(myCards))
  } // run

public static void main(String agrs[]) {
  TestArray myApp = new TestArray();
  myApp.run();
}

UGH2: The use of Array II

1. Modify UGH1 to check if we have a flush Hint: use the getSuit().

2. Modify this program: Add a loop to draw cards until there is a flush.