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.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 4GZ
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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

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