Question: data structures CS 2 0 2 8 c mplement a 'Deck' class using a linked list to act as a queue: The Deck class should

data structures CS2028c mplement a 'Deck' class using a linked list to act as a queue:
The Deck class should represent a player's deck of cards. Each card drawn will come
from the front of the deck (first in, first out - FIFO), and any cards won during gameplay
must be added to the tail of the deck.
Example:
If the player plays two cards (2 and 8) and the computer plays one card (6) in a round,
the player wins the round. The player collects all three cards (2,8, and 6) and adds them
to their deck. The order of these three cards does not matter.
The class should include a method to display the number of cards remaining in the deck.
The player can ask how many cards remain in their own deck, as well as how many
cards the computer's deck has at any point during the game.
2. Implement a 'SidePile' class:
The SidePile class will use an array-based stack with a maximum capacity of 5 cards.
Players cannot peek at what is in their side pile. Players can only add (push) or remove
(pop) cards from the top of the stack.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!