Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using JAVA create: Card Game: Game of War Create a card game application and classes with the following capabilities: Use Enums for the suit and

Using JAVA create:

Card Game: Game of War

Create a card game application and classes with the following capabilities:

Use Enums for the suit and value of a card

Include sort() (a hand) and shuffle() (a deck) methods

Add a dealCard() method Deck class

Modify the GroupOfCards to be an abstract class

Create a class called GameOfWar that has three methods:

initialize()

play()

displayWinner()

Create a GameDriver class that asks the user if he/she wants to play a game and then instantiates a GameOfWar object where the actual game is played (see above).

Use a constant to hold the number of rounds to play. Use this to verify that your application is working correctly.

Make sure you have a placeholder for the pile of cards that are being compared

Make sure you have a placeholder for each players pile as they win rounds

Create the methods to play the actual game of War. This should include the following:

Splitting the deck (each player should have 26 cards to start)

Comparing the top card from each player

Determining a winner and putting the cards into the winning players pile

Handling the scenario where a player (or both) has no more cards in his/their hand

At this point the players pile should become the players hand

Make sure that your cards come out in the proper order when you turn the pile over

Handling the scenario of War where the players cards are the same value. In this scenario, make sure the following is done:

Each player adds their next three cards to the pile and then turns over/compares their fourth card

The winner of the fourth card comparison wins all the cards

If there is a tie, this scenario continues

Playing until the game ends (one player has all the cards) or the number of rounds played => the number of rounds constant

Determining who is the winner of the game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

4. Build team spirit:

Answered: 1 week ago

Question

3. Evaluate a Web-based training site.

Answered: 1 week ago