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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education