Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ 1.) Create a program to shuffle and deal a deck of cards. The program should consist of class Card, class DeckOfCards and a driver

C++

1.) Create a program to shuffle and deal a deck of cards. The program should consist of class Card, class DeckOfCards and a driver program. Class Card should provide:

2.) Modify the program you developed in the previous exercise 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 face values).

3.) Use the work in the previous exercises to write a program that deals two five-card poker hands, evaluates each hand and determines which is the better hand. The screen dialog should appear as follows:

4.) Use the work in the previous exercises so that it handles changes in the hands. The dealers five-card hand is dealt face down so the player cannot see it. The program should then evaluate the dealers hand, and, based on the quality of the hand, the dealer should draw one, two or three more cards to replace the corresponding number of unneeded cards in the original hand. The program should then reevaluate the dealers hand. Likewise, the player is allowed to decide which cards of the players hand to replace. The program should then evaluate both hands and determine who wins

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions