Blackjack is a card game where the goal is to reach a score of 21. Create a java version of this game with the following requirements. Extend the JPanel class and create an array of 52 cards. Add four sets of numbers from 1 to 10. Use J for Jack, Q for queen, K for king, and A for ace. Jack through king will have a value of 10, and the ace will have a value of 11. Deal two cards to the user and two cards to the computer. Do not show the value of the computer's first two cards to the user. Add buttons Hit, Stay, and Reset. If the user selects the "Hit" button, randomly select one of the cards from the array, and give it to the user. (After selecting a card, do not reuse this index during the rest of the game.) If the dealer has less than 21, "hit" the dealer, too. When the user selects the "Stay" button, add up the card values. The winner is the person who is closest to 21 without going over. Name the class Blackjack.java.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question

Blackjack is a card game where the goal is to reach a score of 21. Create a java version of this game with the following requirements. Extend the JPanel class and create an array of 52 cards. Add four sets of numbers from 1 to 10. Use J for Jack, Q for queen, K for king, and A for ace. Jack through king will have a value of 10, and the ace will have a value of 11. Deal two cards to the user and two cards to the computer. Do not show the value of the computer's first two cards to the user. Add buttons Hit, Stay, and Reset. If the user selects the "Hit" button, randomly select one of the cards from the array, and give it to the user. (After selecting a card, do not reuse this index during the rest of the game.) If the dealer has less than 21, "hit" the dealer, too. When the user selects the "Stay" button, add up the card values. The winner is the person who is closest to 21 without going over. Name the class Blackjack.java.

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT