Question
JAVA: Egyptian Rat Slap Complete the following classes to model the ERS game. Card Card(int number, Suit suit) Suit suit int number String getName() String
JAVA: Egyptian Rat Slap
Complete the following classes to model the ERS game.
Card
Card(int number, Suit suit)
Suit suit
int number
String getName()
String toString()
Stack
ArrayList
void addCard(Card c)
ArrayList
void clear()
int size()
String toString()
ERSGame
Stack pot
- the stack of cards in the middle.
boolean isASandwich()
- the same number sandwiching any other number Ex: 3, 5, 3
boolean isADouble()
- 2 of the same number in a row.
boolean isAFlush()
- 3 of the same suit in a row.
boolean isAStraight()
- A sequence of 3 cards with sequential values. Ex: 3, 4, 5 or 10, J, Q or 5, 4, 3 or Q, J, 10
boolean isASum()
- 2 cards that sum to 10. Ex: 3, 7 or 6, 4 or 2, 8
boolean isATopBottom()
- The top card and the bottom card are the same value.
write method in Main.java
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