Question: JAVA Given these arrays public String[] ranks = {2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace}; public String[] suits =
JAVA Given these arrays
public String[] ranks = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"};
public String[] suits = {"Clubs", "Diamonds", "Hearts", "Spades"};
public String[] deck // initialize to size of 52 for the number of cards there are in a standard deck (NO JOKERS)
Create a method called "public CardDeck()". Yhis will be your constructor for your class and will be where you fill your "deck" array.
For starters, use a for-loop within a for-loop, one for the ranks and one for the suits. Initialize the index tracker of the "deck" array OUTSIDE of these for-loops. Remember to store each card in "deck" as you say it: "rank" of "suit". For example, "3 of Hearts".
Then, create "public String royalFlush()", which returns a String of cards that are contained in a Royal Flush poker hand.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
