Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is my pokerhand code in C++ Pokerhand.h PokerHand_test.cpp PokerHand.cpp The code works perfectly, I just have a problem with two pair and full house.

This is my pokerhand code in C++
Pokerhand.h
PokerHand_test.cpp
PokerHand.cpp
The code works perfectly, I just have a problem with two pair and full house. If I enter 2,2,3,3,3 I get full house, but if I put 2,3,3,3,2 I get three of a kind.
Can you please help me? Check which line is not correct.
Picture 9,10 are a sample of the code.
Also, I see an error which I dont know why, could you please help with that too? Thank you so much (last picture)
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Poker Hand.hu Poker Hand.cpp Poker Hand_test.cpp 1 bool containsPair(int hand []); 2 bool containsTwoPair(int hand[]); bool contains ThreeOfakind(int hand []); bool contains Straight(int hand[]); 5 bool contains Full House(int hand[]); 6 bool contains FourOfaKind(int hand[]); 11 Pokerhand.hu Poker Hand.cpp U PokerHand_test.cpp 1 7/include the essential files 2 #include 3 using namespace std; 4 1/declare a constant variable 5 const int handsz - 5; 6 7 //declare function signatures 8 bool containsPair(int hand(); 9 bobl contains TwoPair(int hand(); 10 bool contains ThreeOfakind(int hand(); 11 bool contains Straight(int hand(); 12 bool contains Full House(int hand(); 13 bool contains FourOfakind(int hand(); 14 15 //main function 1 16 int main O 17 - { 18 //declare an array of size HAND SIZE 19 int hand[handsz]; 20 21 1/prompt and read five cards 22 cout> hand[0]; 27 } 28 29 // check if the cards contains fourofkindornot 30 //by calling the function 31 //if the return value true, then print massage 32 if (contains FourOfakind(hand)) 33 cout > hand[i]; 22 23 24 1/check if the cards contains fourofkindornot 25 //by calling the function 26 //if the return value true, then print massage 27 if (contains FourofakindChand)) 28 cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions