use java to create a card game with the implements listed for the program. If you are able to do the first couple of steps that would be helpful and for step one use an array list with the following code. The code below should create 52 cards. String[] suits = {"Hearts", "Clubs", "Spades", "Diamonds"}; String[] numbers = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};          for(String oneSuit : suits){    for(String num : numbers){                       System.out.println(oneSuit + " " + num);                     } }

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
Question
100%

use java to create a card game with the implements listed for the program.

If you are able to do the first couple of steps that would be helpful and for step one use an array list with the following code. The code below should create 52 cards.

String[] suits = {"Hearts", "Clubs", "Spades", "Diamonds"};

String[] numbers = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};

        

for(String oneSuit : suits){

   for(String num : numbers){

                

     System.out.println(oneSuit + " " + num);

                

   }

}

create a program that implements the following card game:
1) You start with a deck of 52 cards, with standard suits and numbers.
2) There are two players. They are both human players.
3) Each player, A and B, has a hand of 5 cards to start. The hand of cards is drawn from
the deck.
4) Player A starts. Player A picks a card in his/her hand.
5) If player B has two cards whose values sum to the value on Player A's card, player A
gets one point. All three cards are discarded. Edit: Player B gets to choose the two
cards which add to the value of Player A's card.
6) If player B lies and the two cards they choose do not add up to As card, player B
loses a point.
7) If player B does not have two cards whose value adds to the value of Player A's card,
then no one gets a point.
8) Player's A card and (if selected) the two cards from Player B are discarded.
9) Both players draw back to 5 cards from the deck.
10) Repeat steps 4 to 9, alternating which player picks a card from their hand.
11) The game ends as soon as one player can not draw up to 5 cards because there are
too few cards in the deck.
12) The winner is the player with the most points. A tie is possible.
Transcribed Image Text:create a program that implements the following card game: 1) You start with a deck of 52 cards, with standard suits and numbers. 2) There are two players. They are both human players. 3) Each player, A and B, has a hand of 5 cards to start. The hand of cards is drawn from the deck. 4) Player A starts. Player A picks a card in his/her hand. 5) If player B has two cards whose values sum to the value on Player A's card, player A gets one point. All three cards are discarded. Edit: Player B gets to choose the two cards which add to the value of Player A's card. 6) If player B lies and the two cards they choose do not add up to As card, player B loses a point. 7) If player B does not have two cards whose value adds to the value of Player A's card, then no one gets a point. 8) Player's A card and (if selected) the two cards from Player B are discarded. 9) Both players draw back to 5 cards from the deck. 10) Repeat steps 4 to 9, alternating which player picks a card from their hand. 11) The game ends as soon as one player can not draw up to 5 cards because there are too few cards in the deck. 12) The winner is the player with the most points. A tie is possible.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
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
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