Twenty-one: The dice game 21 is a variation of casino Blackjack. Consider a heads-up game between a solitary player and the dealer. In each round of the game the following sequence of events occurs:
Your first job is to write an application in Java that allows a human user to play this game against a computer dealer. What I haven't told you is how the dealer will decide when to stop. This is called the "dealer's stopping rule". The deaeler's stopping rule is basically a point value threshold that once crossed forces the dealer to hold. That is, it's just a number (and it must be constant). For example, suppose the stopping rule is "hold on 17". Then, once the dealer has accumulated 17 or more points they hold, a winner is determined, and the round is over. For the first part of this project you can use any stopping rule you like.
Your second job is to determine what the best stopping rule is for the dealer. You will do this by writing a program that plays thousands of games of computer player against computer dealer. Your program will serve as an experiment that allows you to determine the optimal stopping rule via computer simulation.
Now do both parts again only with the rule that two dice must be rolled at a time in all situations. What is the dealer's optimal stopping rule for this variation of the game? Determine via simulation.
For each part of this assignment use the following naming convention for your test classes:
Besides the test classes your solutions should include at least four other classes: A Player class, a Dealer class, a Game class, and a Die class. You may need more than these to answer all three parts. Include with your source a ReadMe.txt file that explains how to use your software, the rationale behind your experimental design, and the results of your experiments.