We can work on C++ programming Poker Hand Analysis

Your class could have the following member functions and member variables. However, it’s up to you to design the class however you like. The following is a suggestion, you can add more member variables and functions or remove any as you like, except shuffle() and printDeck(): (Note: operators must be implemented)

bool empty(); //returns true if deck has no cards

int cardIndex; //marks the index of the next card in the deck

Card deck[52];// this is your final deck of cards
const int DECK_SIZE = 52;// this is the size of your deck
void shuffle(); // puts cards in random order
friend ostream& operator<<(ostream& out, const Deck& deck); // prints all the cards to the console
Card dealCard(); // returns the next card in the deck
Card getCardAt(int index);// gets the Card at the given index
Deck(); // this is the constructor
Think about which member functions and member variables should be public and private.

Notice your Deck class has an array of size 52. This is because a classic that has 4 suits each containing 13 rankings.

Card Class

Notice in the Deck class, your deck array is of data type Card. You must define this class as well. A card consists of two entities, a suit and a value. There are four suits, (hearts, diamonds, clubs, and spades), and 13 values (numbers 2-10, A for ace, K for king, Q for queen and J for jack. Your Card class should look something like below, remember this is just a suggestion and you may add or omit to the list of member variables and function as you see suitable (Hint, you may want two string arrays to represent the suits and the values). Again, I will leave it up to you to determine the access for each member variable and member function. (Note: operators must be implemented)

string suit; string value; string getSuit(); string getValue(); void setSuit(string suit); void setValue(string value); friend ostream& operator<<(ostream& out, const Card& card); Card(string suit, string value); Card(int suit, int string); Card();

Testing your Deck and Card Classes

To test your Deck and Card classes, write a program that will print out cards in random order).

Your program output should look like the following:

1: Jack of Diamonds
2: Ace of Spades
3: Six of Spades
4: Nine of Diamonds
5: Ten of Spades
6: Four of Spades
7: Four of Clubs
8: Jack of Clubs
9: Three of Spades
10: Seven of Clubs
11: Queen of Diamonds
12: Eight of Clubs
13: Ace of Clubs
14: Eight of Hearts
15: Seven of Hearts
16: Queen of Hearts
17: Three of Clubs
18: Eight of Spades
19: Four of Hearts
20: Eight of Diamonds
21: Queen of Spades
22: Five of Clubs
23: Ten of Clubs
24: Three of Diamonds
25: Queen of Clubs
26: Five of Hearts
27: Jack of Spades
28: Six of Diamonds
29: Five of Diamonds
30: Jack of Hearts
31: Two of Spades
32: Six of Hearts
33: Four of Diamonds
34: Ace of Diamonds
35: Ace of Hearts
36: King of Spades
37: King of Clubs
38: Two of Diamonds
39: Nine of Hearts
40: Seven of Spades
41: Nine of Clubs
42: Five of Spades
43: Two of Clubs
44: Ten of Hearts
45: Three of Hearts
46: Ten of Diamonds
47: Seven of Diamonds
48: Two of Hearts
49: King of Hearts
50: Nine of Spades
51: Six of Clubs
52: King of Diamonds
CardHand Class

Next, create a class called CardHand. Your class should have the following:

a vector to store all the cards in a player’s hand.
Remember in a card game, a player is usually dealt one card at a time, so make sure your CardHand class has the ability to take in one card at a time.
Accessors and Mutators where needed
Just like in the other classes, I will leave it up to you to determine access for member variable and member function.

CardHandScorer Class

Next, create another class, CardHandScorer that is used to analyze a players hand and determine a score for that hand. Because we are going to create a Poker game we will focus on making a scorer for Poker only, though in the future, we will add function for other card games such as Blackjack. The CardHandScorer class should have the following:

a static function that takes a CardHand object as an argument. The purpose of this static function is to return the score for the Poker hand. This score will be stored in a PokerScore object that is mention in the next section.
The function should analyze the CardHand and add all possible scores to the PokerScore object in which it will then return this object.

PokerScore Class

Next, create a PokerScore class. In the game of Poker, a player’s hand can have multiple scores. For example, if a player has four-of-a-kind, they also have, three of a kind, two pairs, one pair, or a high card . See the list of the different poker hand scores below. Your PokerScore class should be designed to hold all the possible scores a particular CardHand has. To do this, create an enumerator of Scores that holds all the possible poker scores. Then, create a vector that can hold the data type of your enumerator, Scores. Your CardHandScorer should have the ability to add scores to a PokerScore object. Here is the declaration of the PokerScore class: (Note: operators must be implemented)

enum Scores{      ROYAL_FLUSH, //A, K, Q, J, 10, all the same suit.      STRAIGHT_FLUSH, //five cards of the same suit and consecutive ranking      FOUR_OF_A_KIND, //four cards of the same ranking      FULL_HOUSE, //three cards of the same rank along with two cards of the same rank      FLUSH, //five cards of the same suit      STRAIGHT, //five cards in consecutive ranking      THREE_OK_A_KIND, //three cards of the same rank      TWO_PAIR, //two cards of the same rank along with another two cards of the same rank      ONE_PAIR, //two cards of the same rank      HIGH_CARD //highest card in the player’s hand

};

vector<Scores> scores;     void operator+=(const Scores& score);  friend bool operator==(const PokerScore& p, Scores score); int size(); Score& operator[](unsigned int index); PokerScore();

Here’s an example of usage of the Deck, Card, CardHand, CardHandScorer, and PokerScore classes:

int main() {

Deck deck;  CardHand ch;     //deal five cards to the card hand  for (int i = 0; i < 5; i++)      ch.addCard(deck.dealCard());     //analyze card hand and get poker scores  PokerScore pokerScore = CardHandScorer::scorePokerHand(ch);

//add a score to pokerScore
pokerScore += PokerScore::FULL_HOUSE;

}
Analyzing the Poker Hands

After you have written and thoroughly tested your class, write a program to analyze the probability of each Poker score. Write a function that does the following:

Deal five cards to five different card hands.
Score one of card hands.
Return the scores for that card hand.
After running this function 1000 time, your program should output how many times each poker score was met. Here’s an example of your output:

    ROYAL_FLUSH: 0      STRAIGHT_FLUSH: 10      FOUR_OF_A_KIND: 30      FULL_HOUSE: 47      FLUSH; 105      STRAIGHT; 146      THREE_OK_A_KIND; 234      TWO_PAIR: 759      ONE_PAIR:823      HIGH_CARD: 1000

Sample Solution

This page of the exposition has 694 words. Download the full form above. Section 1: The sort of move that I accept best speaks to my age is hip-jump move, which is a social move. Well known hip-jump moves incorporate the Drop, the Whip, and the Dab, and hose are just a bunch of the considerable number of kinds of hip-bounce moves. It takes into account individuals to consolidate disposition, singularity, motioning, and otherworldliness. a. This move communicates the perspectives of my age since it can identify with disobedience and change if the artist needs it do that. It can include numerous quick developments that can look like the ever-expanding quick paced ways of life in which we live in. It likewise joins a lot of perkiness and investigation dependent on various rhythms and individual, social, and social encounters. b. The connection to a culture other than “American” culture with this move would be some African social moves which could include the bowing of knees and bended spines. They can likewise include percussion and comedy, much like Hip-jump moves. Koroso move can be to some degree identified with hip-jump in that includes exceptionally aerobatic and troublesome shapes, inviting rivalry move, and is typically performed by more youthful artists. c. Contrasted with the young people of my folks’ age during the 1970s, there are a few likenesses and contrasts. Their disco-style move got well known on TV shows of the day simply like hip-jump does now. It took into consideration interesting innovativeness and articulation as it was regularly situational, so artists would create their own moves as the music continued playing. One way that disco moving varies from hip-bounce is that disco artists wore incredibly crazy and stylish apparel. Disco moving additionally would in general be progressively focused towards growing opportunities, and it was likewise a period where medication misuse and indiscrimination hit an unsurpassed high. Section 2: Mary Wigman is one of the originators of German expressionistic present day move (show move) and she was propelled by the Sufi Dance. At the point when she was experiencing a period of incredible sadness, she saw the developments she made right now. It permitted her to communicate her feelings and stresses through influences, withdrawals, reshapings, and beats. Her movement was made by “feeling through” or utilizing the delicate human body. Gabrielle Roth made advanced euphoria move as an approach to help soul searchers locate the genuine quintessence of self. It’s a daze hit the dance floor with a moving reflection that comprises of a procedure of 5 rhythms wherein every one of them have their own interesting properties. They are called streaming, staccato, bedlam, expressive, and stillness. To her, it is about enter an alternate condition of awareness that opens a more noteworthy articulation of the genuine self. Lynn Wood built up a training called Conscious Movement Process Work. Her motivation for this is to dispose of blocked vitality from negative encounters. She demonstrates that it includes tuning in to the body and perceiving negative patterns so as to crush them and supplant them with increasingly positive examples. a. Move and expressions give a methods for recuperating to society as they can give intends to which individuals can encounter a sound impression of the brain, body, and soul. Through move treatment, patients can all the more effectively communicate without talking, which can recuperate their enthusiastic injuries. Permitting the body stream while moving discharges endorphins, which thus assist individuals with feeling a more prominent feeling of prosperity. Move and expressions of the human experience can be as a methods for mending the mind through complete give up to the soul, getting away from the real world, and being at one with the universe. As talked about before about Wood, her procedure realizes advantages, for example, recharged vitality, improved connections, and a decrease in physical torment. These things are for the most part useful to society. b. I do accept that move and expressions of the human experience can give a methods for mending to society. That is on the grounds that I have encountered it with my own self. It doesn’t make a difference on the off chance that it is a basic tap with my feet or utilizing my entire body on the grounds that whichever way I experience a sentiment of discharge. I feel bliss, assuaged, and progressively positive in the wake of communicating. In view of this, I do genuinely feel that move and human expressions can by an approach to mend society.>

Is this question part of your Assignment?

We can help

Our aim is to help you get A+ grades on your Coursework.

We handle assignments in a multiplicity of subject areas including Admission Essays, General Essays, Case Studies, Coursework, Dissertations, Editing, Research Papers, and Research proposals

Header Button Label: Get Started NowGet Started Header Button Label: View writing samplesView writing samples