Answered step by step
Verified Expert Solution
Question
1 Approved Answer
n this assessment, write a simple card game similar to the classic card game war. Each card will be represented using an integer stored inside
n this assessment, write a simple card game similar to the classic card game "war." Each card will be represented using an integer stored inside an array. Two players will receive five cards each, and then the players will compete for five rounds to see who has the higher card during each turn.
For example, if player one has cards and player two has cards the game would be played as follows:
Round :
Player : Player : Player wins!
Round :
Player : Player : Player wins!
and so on
At the end of the game, the player who won the most rounds is the winner.
Notes:
You can hardcode the values for the cards for each player. You do not have to write any logic for randomizing the cards or dealing cards. However, for an extra points, you can add this functionality.
For example: a player's cards can be stored in an array such as: int player;
For another extra points, make the game more flexible, so that each player can have to cards the game should prompt the user for the number of cards per player at the beginning of the program
Do NOT use the ArrayList class for this assignment.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started