Question: Write in Java: A. Deck class 1. Add member variable a. Data type Set to represent the deck of cards 2. Generate getter/setter for member
Write in Java:
A. Deck class
1. Add member variable
a. Data type Set
2. Generate getter/setter for member variables
B. Game class
1. Add member variables
a. Data type enumeration Suit to represent the trump suite of Euchre
b. Data type class Player to represent the lead player for each hand
c. Data type class Player to represent the dealer for each hand
d. Data type class Player to represent which player won the current trick/hand
e. Data type int to represent the current round of the game
f. Data type ArrayList
g. Data type class Deck to represent the deck of cards for the game
h. Data class Scanner to get information from the user
2. Generate getters/setters for the member variables
3. Write a custom constructor that
a. Has no parameters
b. Calls method createTeams() which will be defined within this class
c. Calls method outputTeams() which will be defined within this class
4. Write method createTeams() that
a. Has no parameters
b. Has return type void
c. Instantiate the member variable of type ArrayList
d. Instantiates two instances of class Team
i. one for TeamOne
ii. one for TeamTwo
iii. set names for each team as appropriate
iv. add each instance to the ArrayList
e. Instantiate the member variable of class Scanner passing System.in as the argument to the constructor
f. Using System.out.println() static method, prompt the user for the human players name
g. Instantiate an instance of class String set equal to the reference object of class Scanner using its method .next()
h. Instantiate an instance of class HumanPlayer
i. Call method .setName() on the reference object of class HumanPlayer passing the value stored in the variable from step g. above
j. Add the reference object of class HumanPlayer to the instance of class Team representing Team One
k. Write a for loop to generate three AiPlayer instances 4
i. Generate a unique name for each AiPlayer and call method .setName() passing the unique name as an argument
ii. Add one AiPlayer instance to the instance of class Team representing Team One
iii. Add the other two AiPlayer instances to the instance of class Team representing Team Two
5. Write method outputTeams() so that
a. It has no parameters
b. Has a return type of void
c. Uses an enhanced for loop to loop through the collection
of member variable of type ArrayList
1. Calls method outputTeam() in class Team
C. HumanPlayer class
Extend class Player.java
Implement methods inherited from class Player:
1. public Card playCard();
2. public void makeTrump();
D. IPlayer interface
Add method signatures:
1. public Card playCard();
2. public void makeTrump();
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
