Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 cards

void addCard(Card c)

ArrayList peekAtTopCards(int number)

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

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