Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Update main() method to do the following: Call static method System.out.println() output to the console Welcome to Euchre! Call static method JOptionPane.showMessageDialog() using the method

Update main() method to do the following:

Call static method System.out.println() output to the console Welcome to Euchre!

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 Lets Play Euchre!

Instantiate an instance of class Game calling the no-argument constructor

A constant for the number of AI players set to the value of 3

A constant for the number of cards in a Euchre deck set to the value of 24

A constant for the number of cards each player is dealt set to the value of 5

A constant for the number of rounds in a hand set to the value of 5

An enumeration for the color of cards so it includes: RED and BLACK

An enumeration for the suit of cards so it includes: CLUBS, DIAMONDS, HEARTS, SPADES

An enumeration for the face value of cards so it includes: NINE, TEN, JACK, QUEEN, KING, ACE

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

Extend class Player.java

Implement methods inherited from class Player:

public Card playCard();

public int makeTrump();

Add method signatures:

public Card playCard();

public void makeTrump();

Declare abstract class Player so that it implements interface IPlayer

Add member variables:

Data type String to represent player name

Generate getters/setters for the member variables

Declare abstract the methods inherited from interface IPlayer

public abstract Card playCard();

public abstract int makeTrump();

Add member variables

Data type ArrayList to represent a team

Data type int to represent the teams score

Data type int to represent the teams tricks taken for each hand

Data type String to represent the teams name

Generate getters/setters for the member variables

Write a custom constructor that instantiates the member variable ArrayList

Write method outputTeams() so that

It has no parameters

Has a return type of void

Outputs the current Teams name

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

Outputs the current Players name

Create package userinterface

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

1 What demand is and what affects it.

Answered: 1 week ago