Question: Main topics: Multiple Classes Declaring / Using Instance Variables Driver Classes Program Specification: You are to write a Class Deck which emulates a full deck
Main topics: Multiple Classes
Declaring Using Instance Variables
Driver Classes
Program Specification:
You are to write a Class Deck which emulates a full deck of playing cards. That is suits Clubs Spades, Hearts, and Diamonds and ranks Ace Jack, Queen, King in cach suit. This of course makes for a total of playing cards in the deck.
Mandatory Instance variable:
private boolean deck new boolean;
Mandatory Instance and Class methods:
public void initDeck
set the values of deck to indicate that they are all
pressent not delt yet.
public boolean emptyDeck
returns wheather or not all the cards in the deck
have already been delt.
public int dealCard
returns a card an int in the range to at random
that has not been delt since the deck was initialize
via intDeck. Also notes in deck that this card is
no longer available.
public static String cardToStringint card
given a card an int in the range to returns
an appropriate String repressentation of this card
based on a and onto mapping of the set
to the cards described above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
