Question
3)This is an uncheck type question. You can not find check button in the Coderunner. Just only use your IDE Write a Java program that
3)This is an uncheck type question. You can not find check button in the Coderunner. Just only use your IDE
Write a Java program that creates a deck of 52 playing cards and shuffles them. The program must then deal the cards in a 4 by 13 table, printing each card's face and suit. The program must use the following classes:
A Card class that represents a single playing card. This class must have a constructor that takes two strings, face and suit, as arguments and initializes the corresponding instance variables.
A DeckOfCards class that represents a deck of playing cards. This class must have a Card[] instance variable deck that stores the cards in the deck, a Random instance variable rand, and a constructor that fills the deck array with 52 Card objects and initializes rand. The class should also have a shuffle() method that shuffles the cards in the deck array and a deal() method that prints each card in the deck array as shown below.
A TestShuffleandDeal class that creates a DeckOfCards object, shuffles it, and deals the cards
Useful information about cards: The faces of the cards are represented by the following strings: "Ace", "Deuce", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King". The suits of the cards are represented by the following strings: "Hearts", "Diamonds", "Clubs", "Spades".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started