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