Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in Java: -Extend class Player.java Implement methods inherited from class Player: public Card playCard(); public int makeTrump(); Add member variables (Hint: you will have

Write in Java:

-Extend class Player.java

Implement methods inherited from class Player:

public Card playCard();

public int makeTrump();

Add member variables (Hint: you will have to explicitly import each enumeration, example: import constants.Constants.Color; ):

Data type enumeration Face to represent the face value of the card

Data type enumeration Suit to represent the suit of the card

Data type enumeration Color to represent the color of the card

Generate getters/setters for member variables

Add member variable

Data type Set to represent the deck of cards

Generate getter/setter for member variables

Add member variables

Data type enumeration Suit to represent the trump suite of Euchre

Data type class Player to represent the lead player for each hand

Data type class Player to represent the dealer for each hand

Data type class Player to represent which player won the current trick/hand

Data type int to represent the current round of the game

Data type ArrayList to represent the two teams of the game

Data type class Deck to represent the deck of cards for the game

Data class Scanner to get information from the user

Generate getters/setters for the member variables

Write a custom constructor that

Has no parameters

Calls method createTeams() which will be defined within this class

Calls method outputTeams() which will be defined within this class

Write method createTeams() that

Has no parameters

Has return type void

Instantiate the member variable of type ArrayList

Instantiates two instances of class Team

one for TeamOne

one for TeamTwo

set names for each team as appropriate

add each instance to the ArrayList member variable

Instantiate the member variable of class Scanner passing System.in as the argument to the constructor

Using System.out.println() static method, prompt the user for the human players name

Instantiate an instance of class String set equal to the reference object of class Scanner using its method .next()

Instantiate an instance of class HumanPlayer

Call method .setName() on the reference object of class HumanPlayer passing the value stored in the variable from step g. above

Add the reference object of class HumanPlayer to the instance of class Team representing Team One

Write a for loop to generate three AiPlayer instances

Generate a unique name for each AiPlayer and call method .setName() passing the unique name as an argument

Add one AiPlayer instance to the instance of class Team representing Team One

Add the other two AiPlayer instances to the instance of class Team representing Team Two

Write method outputTeams() so that

It has no parameters

Has a return type of void

Uses an enhanced for loop to loop through the collection of member variable of type ArrayList

Calls method outputTeam() in class Team

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

More Books

Students also viewed these Databases questions

Question

To solve by the graphical methods 2x +3y = 9 9x - 8y = 10

Answered: 1 week ago

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago