Question: Create a class called CardDeck with a standard 5 2 - card deck of playing cards ( or several of them ) , with methods
Create a class called CardDeck with a standard card deck of playing cards or several of them with methods deal dealrandom shuffle count dealt undealt as specified below. The class must include:
Object Data:
cards list of Card objects
top index of last card dealt undealt cards have index deck.top
Methods:
CardDeckn new deck with n cards n defaults to
shuffle replace any dealt cards and randomize the deck's order
deal take off the top card and return it
dealrandom take an undealt card from a random spot in the deck
count total number of cards n
dealt number of cards that have been dealt since last shuffle
undealt number of cards that have yet to be dealt
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
