In the card game War, a deck of playing cards is divided between two players. Each player exposed a card; the player whose card has the higher value wins possession of both exposed cards. Create a console-based computerized game of War named WardCardGame in which a standard 52-card deck is randomly divided between two players, one of which is the computer. Reveal one card for the computer and one card for the player at a time. Award two points for the player whose card has the higher value. (For this game, the king is the highest card, followed y the queen and jack, then the numbers 10 down to 2, and finally the ace.) if the computer and player expose cards with equal values in the same turn, award one point to each. At the end of game, all 52 cards should have been played only once, and the sum of the player’s and computer’s score will be 52. Use an array of 52 integers to store unique values for each- card. Write a method name FillDeck() that places 52 unique values into this array. Write another method named SelectCard() that you call twice on each deal to select a unique card for each player, with no repetition of cards in 26 deals. (To pause the play between each dealt hand, use a call to ReadLine().) Create a GUI version of the War card game described in above, and name it WarCardGa

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 1CP
icon
Related questions
icon
Concept explainers
Question

In the card game War, a deck of playing cards is divided between two players. Each player exposed
a card; the player whose card has the higher value wins possession of both exposed cards. Create
a console-based computerized game of War named WardCardGame in which a standard 52-card
deck is randomly divided between two players, one of which is the computer. Reveal one card for
the computer and one card for the player at a time. Award two points for the player whose card
has the higher value. (For this game, the king is the highest card, followed y the queen and jack,
then the numbers 10 down to 2, and finally the ace.) if the computer and player expose cards with
equal values in the same turn, award one point to each. At the end of game, all 52 cards should
have been played only once, and the sum of the player’s and computer’s score will be 52.
Use an array of 52 integers to store unique values for each- card. Write a method name FillDeck()
that places 52 unique values into this array. Write another method named SelectCard() that you
call twice on each deal to select a unique card for each player, with no repetition of cards in 26
deals. (To pause the play between each dealt hand, use a call to ReadLine().)
Create a GUI version of the War card game described in above, and name it WarCardGameGUI.
Let the user click a button to deal the cards, then make that button invisible and expose a Play
button. Each time the user clicks Play, a pair of cards is revealed. To keep the Frame size
reasonable, you might want to erase the output label’s contents every four hands or so.

Please follow full instructions 

Create a GUI version of the War card game described in above, and name it WarCardGameGUI.
Let the user click a button to deal the cards, then make that button invisible and expose a Play
button. Each time the user clicks Play, a pair of cards is revealed. To keep the Frame size
reasonable, you might want to erase the output label’s contents every four hands or so.
The game sequences windows frame pictures example:
War Card Game
Click to deal
Deal
War Card Game
Click to play a hand
Play
Transcribed Image Text:Create a GUI version of the War card game described in above, and name it WarCardGameGUI. Let the user click a button to deal the cards, then make that button invisible and expose a Play button. Each time the user clicks Play, a pair of cards is revealed. To keep the Frame size reasonable, you might want to erase the output label’s contents every four hands or so. The game sequences windows frame pictures example: War Card Game Click to deal Deal War Card Game Click to play a hand Play
War Card Game
Click to play a hand
Play
Deal #1 Computer has 2 of diamonds Player has 8 of hearts
Computer score is O Player score is 2
War Card Game
Click to play a hand
Play
Deal #1 Computer has 2 of diamonds Player has 8 of hearts
Computer score is 0 Player score is 2
Deal #2 Computer has Jack of hearts Player has Jack of dlubs
Computer score is 1 Player score is 3
Note: Zip the whole project folder and add your name to the zip file name as A3-student's name; then
upload to blackboard before Due Date 4/30 midnight.
Transcribed Image Text:War Card Game Click to play a hand Play Deal #1 Computer has 2 of diamonds Player has 8 of hearts Computer score is O Player score is 2 War Card Game Click to play a hand Play Deal #1 Computer has 2 of diamonds Player has 8 of hearts Computer score is 0 Player score is 2 Deal #2 Computer has Jack of hearts Player has Jack of dlubs Computer score is 1 Player score is 3 Note: Zip the whole project folder and add your name to the zip file name as A3-student's name; then upload to blackboard before Due Date 4/30 midnight.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage