/** * Given a deck string, draw a random card from the deck. * You may assume that the deck string is well-formed. * @pa
Posted: Wed Apr 27, 2022 5:02 pm
/** * Given a deck string, draw a random card from the deck. * You may assume that the deck string is well-formed. * @param deck the deck string. * @return a random cardString from the deck. If the deck is empty, return the empty string". * TASK 5 */ public static String drawFromDeck (String deck) { if (deck.equals("")) { return; } else { int deckcardsNum = deck.length() / 2; Random random - new Random(); int i = random.nextInt(deckCardsNum); return deck.substring(2 * i, 2 + 2 * i); )