USE C++ OR JAVA POST SOURCE CODE WILL ONLY UPVOTE IF CORRECT --------------------------------------------------------------------------------------------------- Create a simple program that plays poker 1000 times with the following rules: Each time the program will: Shuffle the 52-card deck and deal yourself 5 cards. Using the remaining 47 cards, deal other 5 players their 5 cards. Determine if your hand would win or lose compared to the others. (Poker hands ranking listed below for reference) Record how many games out of 1000 you won. For each rank of hand, report the percentage of hands having that rank, and the average winning percentage for each rank (out of those 1000 games). --------------------------------------------------------------------------------------------------- Your program will produce 2 output files (1000 entries): A session log output as a CSV (comma-separated value) file, with each hand (you and 5 other hands) on a separate line. For each hand: Output the cards in the hand; what the hand was evaluated as; and its winning percentage. A summary showing the percentage of hands falling into each rank, and the overall win percentage for each rank, as a ‘normal’ text file. Don’t just list the percentages; add enough text to make it reader-friendly. --------------------------------------------------------------------------------------------------- The system random-number generator (random() and related functions) for the most common development environments will be more than adequate for this project. Picture reference for card rankings
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
USE C++ OR JAVA
POST SOURCE CODE
WILL ONLY UPVOTE IF CORRECT
---------------------------------------------------------------------------------------------------
Create a simple program that plays poker 1000 times with the following rules:
Each time the program will:
- Shuffle the 52-card deck and deal yourself 5 cards.
- Using the remaining 47 cards, deal other 5 players their 5 cards.
- Determine if your hand would win or lose compared to the others. (Poker hands ranking listed below for reference)
- Record how many games out of 1000 you won.
- For each rank of hand, report the percentage of hands having that rank, and the average winning percentage for each rank (out of those 1000 games).
---------------------------------------------------------------------------------------------------
Your program will produce 2 output files (1000 entries):
- A session log output as a CSV (comma-separated value) file, with each hand (you and 5 other hands) on a separate line.
- For each hand: Output the cards in the hand; what the hand was evaluated as; and its winning percentage.
- A summary showing the percentage of hands falling into each rank, and the overall win percentage for each rank, as a ‘normal’ text file.
- Don’t just list the percentages; add enough text to make it reader-friendly.
---------------------------------------------------------------------------------------------------
The system random-number generator (random() and related functions) for the most common development environments will be more than adequate for this project.
Picture reference for card rankings
Create a simple program that plays poker 1000 times with the following rules:
Each time the program will:
- Shuffle the 52-card deck and deal yourself 5 cards.
- Using the remaining 47 cards, deal other 5 players their 5 cards.
- Determine if your hand would win or lose compared to the others. (Poker hands ranking listed below for reference)
- Record how many games out of 1000 you won.
- For each rank of hand, report the percentage of hands having that rank, and the average winning percentage for each rank (out of those 1000 games).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps