Given the started shell, design, code, and test an object-oriented, multiple class, multiple file, Java program that allows a player to play Blackjack against the computer.
Rules and how to play Blackjack: The object of the blackjack game is to accumulate cards with point totals as close to 21 without going over 21. Face cards (Jacks, Queens and Kings) are worth 10 points. Aces are worth 1 or 11, whichever is preferable. Other cards are represented by their number.
To win you need to beat the dealer/computer without busting. You bust when your cards total more than 21 and you lose automatically. The winner is whoever has closest to a total of 21. You reach 21 by adding up the values of the cards.
If player and the House tie, it is a push and no one wins, unless the computer has an Ace and 10 (Blackjack) on the first two cards dealt — this is an automatic computer win, regardless of the player’s cards. The computer must “hit” (accept another card) with a count < 17 and must “stand” (take no more cards) with a count of 17 or higher, the human player makes their own choice regarding “hit” (take another card) or “stand” (accept no more cards). At most a player can have no more than 5 cards.
To win you need to beat the dealer/computer without busting. You automatically lose if your cards total more than 21. The winner is whoever has closest to a total of 21 without going over. You reach 21 by adding up the values of the cards.
Playing blackjack
The game will use just one deck that is reshuffled after each hand is played. At the start of the game, both the player and the computer/dealer will be given 5 points. The game will be played until either the player or the computer/dealer has lost all of their points. Each hand will result in one of the following outcomes:
1. Player Win: the player takes a point from the computer/dealer for a winning hand (hand value <=21 and greater than the computer/dealer hand)
2. Computer Win: the computer/dealer taking a point from the player because the player went bust or the computer/dealer had a winning hand (hand value <=21 and greater than the player) or the computer initially had a Blackjack (21 hand with first two cards)
3. Push (tie): no points exchanged
The player is dealt two cards face up. The computer/dealer gets one face up, one face down. The player either stays or takes more cards to try and get closer to 21 without busting. If the player does not bust, the computer/dealer turns up the down card. By rule, on counts of 17 or higher the dealer must stay; on counts of 16 or lower the dealer must draw. You need to include this logic in the program for the dealer/computer.
For Submission:
· Formal test plan that includes necessary test cases to verify that your program is working correctly
· NetBeans zip project containing your project


0 comments