10.11 (Card Shuffling and Dealing) Modify the program you developed in Exercise
ID: 3535010 • Letter: 1
Question
10.11 (Card Shuffling and Dealing) Modify the program you developed in Exercise 10.10 so that it deals a five-card poker hand. Then write functions to accomplish each of the following:
a) Determine whether the hand contains a pair.
b) Determine whether the hand contains two pairs.
c) Determine whether the hand contains three of a kind (e.g., three jacks).
d) Determine whether the hand contains four of a kind (e.g., four aces).
e) Determine whether the hand contains a flush (i.e., all five cards of the same suit).
f) Determine whether the hand contains a straight (i.e., five cards of consecutive facevalues).
Explanation / Answer
#include #include #include #include using namespace std; int main() { srand(time(0)); int deck[52]; int i; string suitnames[4]={"spades", "diamonds", "clubs", "hearts"}; string ranknames[13]={"ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "jack", "queen", "king"}; // create a new deck, with cards in order, but unique for(i=0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.