Question: 2. Write a Java program to simulate Blackjack. Here are the rules of the game: a. There is one deck of playing cards, therefore no

 2. Write a Java program to simulate Blackjack. Here are the

2. Write a Java program to simulate Blackjack. Here are the rules of the game: a. There is one deck of playing cards, therefore no duplicates. b. Cards are drawn randomly (ShuffleO method). c. The value of a hand is computed by adding the values of the cards in hand. d. The value of a numeric card such as five is its numerical value. e. The value of a face card is 10. f. Ace is either 1 or 11. g. Ace is 11 unless it puts the total value of the hand over 21. h. Second, third or fourth Ace are all counted as 1 i. Generate a random number between 16-21. Keep drawing as many cards (AddCardO method) as needed until the total value of the hand is greater than this random number. This is the dealer, whom you play against. Other than the dealer there is only one player. For the dealer, you only need the total and not the actual cards j. k. You do not need to declare a winner. You do not need to re-shuffle the remaining cards after each drawing. You should have a class Hand, in which you compute and return the value of a hand based on the above rules. I. m. You should have a "public class BlackjackHand extends Hand", which notifies the n. Sort the cards in hand, based on the color and then based on the numerical value, user if it is a Blackjack (only two cards are drawn with the totai value of 21) then log all drawn cards and the total value of a hand

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!