Euchre project

Create a new Java Application project named Euchre allowing Netbeans IDE to create the main class called Euchre.java

Euchre class

Update main() method to do the following:

1. Call static method System.out.println() output to the console "Welcome to Euchre!"
2. Call static method JOptionPane.showMessageDialog() using the method signature that receives two arguments; the first argument should be null, the second argument should be explicit text "Let's Play Euchre!"
3. Instantiate an instance of class Game calling the no-argument constructor

Constants class

Add the following:

1. A constant for the number of AI players set to the value of 3
2. A constant for the number of cards in a Euchre deck set to the value of 24
3. A constant for the number of cards each player is dealt set to the value of 5
4. A constant for the number of rounds in a hand set to the value of 5
5. An enumeration for the color of cards so it includes: RED and BLACK
6. An enumeration for the suit of cards so it includes: CLUBS, DIAMONDS, HEARTS, SPADES
7. An enumeration for the face value of cards so it includes: NINE, TEN, JACK, QUEEN, KING, ACE

core package

AiPlayer class

Extend class Player.java

Implement methods inherited from class Player:

1. public Card playCard();
2. public void makeTrump();

Card class

1. Add member variables (Hint: you will have to explicitly import each enumeration, example: import constants.Constants.Color; ):
a. Data type enumeration Face to represent the face value of the card
b. Data type enumeration Suit to represent the suit of the card
c. Data type enumeration Color to represent the color of the card
2. Generate getters/setters for member variables

Deck class

1. Add member variable
a. Data type Set< Card> to represent the deck of cards
2. Generate getter/setter for member variables

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< Team> to represent the two teams of the game
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< Team>
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< Team> member variable
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 player's 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
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< Team>
1. Calls method outputTeam() in class Team

HumanPlayer class

Extend class Player.java

Implement methods inherited from class Player:

1. public Card playCard();
2. public void makeTrump();

IPlayer interface

Add method signatures:

1. public Card playCard();
2. public void makeTrump();

Player class

1. Declare abstract class Player so that it implements interface IPlayer
2. Add member variables:
a. Data type String to represent player name
3. Generate getters/setters for the member variables
4. Declare abstract the methods inherited from interface IPlayer
a. public abstract Card playCard();
b. public abstract void makeTrump();

Team class

1. Add member variables
a. Data type ArrayList< Player> to represent a team
b. Data type int to represent the team’s score
c. Data type int to represent the team’s tricks taken for each hand
d. Data type String to represent the team’s name
2. Generate getters/setters for the member variables
3. Write a custom constructor that instantiates the member variable ArrayList< Player>
4. Write method outputTeams() so that
a. It has no parameters
b. Has a return type of void
c. Outputs the current Team’s name
d. Uses an enhanced for loop to loop through the collection of class Team’s member variable ArrayList< Player>
i. Outputs the current Player's name

userinterface package

Create package userinterface

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.