Question
Blackjack is a simple card game that is played with standard deck of 52 cards. In casinos, the dealer will typically use multiple decks to
Blackjack is a simple card game that is played with standard deck of 52 cards. In casinos, the dealer will typically use multiple decks to make it more difficult to "count cards", thereby skewing the odds in favor of the player. For your assignment, you must only use a single deck of cards.
Though there can be multiple players at a Blackjack game table, each player is only competing against the Dealer. For your assignment, you can assume there is only one Player and the Dealer.
The rules of the game are very simple, but you will implement an even more simplified version of the game: The dealer deals a card face up to the Player and a card face down to the Dealer. A second card is dealt face up to the Player and a card face up to the dealer. After the cards are dealt, the game begins with the Player.
The Dealer calculates the value of the Player's hand. The 10, Jack, Queen, and King are worth 10 points each. The 2 through 9 are worth their face value. The Ace is worth either 1 or 11. The object of the game is to have a hand that is as close as possible to 21 points without going over. If the point value goes over 21, it is called a "Bust" and the Player loses the hand. Obviously, with only 2 cards dealt, it is impossible to go over 21. However, if the two cards total exactly 21 (such as an Ace and a King), this is known as "Blackjack" and it is impossible for the Player to lose this hand; although, the Player could tie with the Dealer, which is known as a "Push".
After the hand is dealt, the Player has two options:
"Hit" which means the Player is dealt another card face up, or
"Stay" which means the Player is satisfied and doesn't want any other cards.
The Player can "Hit" as many times as they want as long as they don't "Bust". If the Player "Busts", they lose immediately although the Dealer must still play their hand. Once the Player "Stays", it is the Dealer's turn. The Dealer must "Hit" if the value of their hand is 16 or less. Assuming the Dealer doesn't "Bust", the Player wins the hand if their point value is more than the Dealer's. The Dealer wins if their point value is more than the Player's. If the value is tied, it is a "Push" and there is no winner on that hand.
Betting happens BEFORE any cards are dealt. A player must only bet whole dollar amounts. A minimum and maximum bet is declared as a part of the game and this can't change during a game regardless of how many hands are dealt.
If the Player wins the hand (and doesn't have "Blackjack"), their bet is paid 2:1 meaning that if they bet $10, they are paid $20 (2 times their original bet). If the Player wins with "Blackjack", they are paid 3:2 meaning that if they bet $10 they are paid $25 (their original bet plus 1.5 times their bet). If the Player loses, they lose their entire bet.
The game is over when the player decides to leave the game and "Cash Out", or they run out of money and do not have the minimum betting amount for another hand.
If you have never played this game, I recommend watching a video to learn the rules. There are additional game rules such as "Doubling Down", "Splitting a Hand", and "Insurance" which you must ignore in this simplified version of the game that you to implement.
DO NOT create a GUI version of this Game.
This entire game should be played in the NetBeans Output window. Try to separate the functionality of the game from the IO that takes place in the Output window.
DO NOT use code from ANY source unless you credit the author (even if it is "open source"). The purpose of the Assignment is for you to create your own implementation, not to use someone else's.
YOUR code must include a class called BlackJackGame, Card, Deck, and Hand and the game must be played with a single Deck object. You may have other classes as well but you must have the 4 required classes. After each hand, the dealt cards are not returned to the Deck. When 2/3 or more of the cards in the Deck have been dealt, the dealt cards are returned to the Deck and the Deck must be shuffled before the next hand is dealt. Let the Player know that the Deck is being shuffled.
In addition to your zipped Netbeans project folder, you must also submit a UML class diagram of all of your classes with attributes and behaviors including the relationships between the classes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started