North Lake College Five Card Poker Hand Project

User Generated

qw123

Programming

North Lake College

Description

Start with the the three files from Figures 8.10-8.12 (Those files are attached). Modify the DeckOfCardsTest.cs file to deal a five-card poker hand. The program will then display a message indicating whether or not the hand contains a pair.

Requirements -

  1. Store the hand dealt as an array of 5 Cards.
  2. Use nested for loops to determine if a pair exists
  3. Because the Face and Suit properties in the Card class are private, you will need to modify the Card class so that you can compare the Face value of each card in the DeckOfCardsTest class.
  4. Display a message if the hand has 2-pair. Note that this is hard to test. I recommend that you generate many hands (like 1000) and only display hands with two pair to test it.

Images included to show sample output.

Unformatted Attachment Preview

Your hand is Three of Spades Four of Diamonds Ace of Hearts Six of Clubs Five of Hearts You do not have a pair Press any key to continue ... Your hand is Six of Diamonds King of Hearts Seven of Diamonds King of Clubs Ten of Clubs You have a pair! Press any key to continue
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello ...


Anonymous
Really great stuff, couldn't ask for more.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags