Program in C++ or Java Simple simulation to estimate your likelihood of winning in a game of poker. Assume the game has 6 players. • Repeatedly (500-1000 times): ◦ Shuffle the 52-card deck, and deal yourself a 5-card hand. ◦ Repeatedly (500-1000 times):   ▪ Using the remaining 47 cards, deal the other 5 players their hands   ▪ Determine if you would win or lose that hand; that is, if your hand would rank highest.2 Update some counters accordingly.   ▪ Reshuffle the deck of 47 cards ◦ Record the proportion of the above hands which you won. • For each rank of hand, report the percentage of hands having that rank, and the average winning percentage (average of the averages) for each rank.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Program in C++ or Java

Simple simulation to estimate your likelihood of winning in a game of poker. Assume the game has 6 players.
• Repeatedly (500-1000 times):
◦ Shuffle the 52-card deck, and deal yourself a 5-card hand.
◦ Repeatedly (500-1000 times):
  ▪ Using the remaining 47 cards, deal the other 5 players their hands
  ▪ Determine if you would win or lose that hand; that is, if your hand would rank highest.2 Update some counters accordingly.
  ▪ Reshuffle the deck of 47 cards ◦ Record the proportion of the above hands which you won.
• For each rank of hand, report the percentage of hands having that rank, and the average winning percentage (average of the averages) for each rank.

Produce 2 output files
• A session log output as a CSV (comma-separated value) file, with each hand on a separate line. For each hand: 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.  

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY