CARD.H DECK.H HAND.CPP HAND.H UTILITIES.CPP UTILITIES.H This assignment deals wi
ID: 3860419 • Letter: C
Question
CARD.H
DECK.H
HAND.CPP
HAND.H
UTILITIES.CPP
UTILITIES.H
This assignment deals with a Deck of Cards. A player is dealt a number of cards–which are held in his Hand. Note that Card, Deck, and Hand are emphasized. These are the three ADTs used within this assignment. Review all classes carefully–especially the Card class.
1.1 Input
This program takes two types of input:
Command line - an integer specifying the desired hand size–i.e., maximum number of cards held by a player
Standard Input - a series of integers in response to interactive prompts. These specify the positions from which to retrieve cards from within the Deck.
1.2 Output
If the program is run with the command, ./cardShuffle 4, the following output should be generated:
Note that the first four lines are user prompts–i.e., the values 1, 8, 16, and 32 must be entered manually. You may use the command:
to enter these values automatically. (This makes use of pipes – a topic from CS 252.) On a Windows system, you would omit the “./”.
The easiest way to see generate the expected output is to run the sample executable solution I have provided.
1.3 Your Tasks
Complete the remaining 2 member functions within the Hand class:
Hand::add
Hand::display
Refer to the comments in hand.h. You are required to complete the definitions of these two functions in hand.cpp.
The add function takes a card and adds it to the end of the cards array.
The display function requires you to print each element of the cards array. An individual Card can be printed with the usual <<operator.
Explanation / Answer
DECK.H
HAND.CPP
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.