Question: Hello, I am having a hard time getting this java program to compile correctly. It's a card game called spades. Below are the parameters for
Hello, I am having a hard time getting this java program to compile correctly. It's a card game called spades. Below are the parameters for each class. Your help is greatly appreciated. Thanks in advance!
[Edited]
Below is the Java Code that I have so far:
[Spades.java]
package spades;
import javax.swing.JOptionPane; import core.Game;
public class Spades {
public static void main(String[] args) { System.out.println("Welcome to Spades!"); //This is the print command JOptionPane.showMessageDialog(null, "Let's Play Spades!"); //This is the JOptionPane Dialog command //Instantiate an instance of class Game calling the no-argument constructor Game game = new Game(); } }
------------------------------------------------------------------------------------------------------------------------------
[Constants.java]
package constants;
public class Constants { public static final int NUM_AI_PLAYERS = 3; public static final int NUM_CARD_DECK = 52; public static final int NUM_CARD_DEALT = 13; public static final int NUM_GAME_ROUND = 13; public static final int MINIMUM_BID_VALUE = 1; public static final int WINNING_SCORE = 200; }
public enum Color{ RED, Black }
public enum Suit{ CLUBS, HEARTS, SPADES, DIAMONDS }
public enum Face{ TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE }
--------------------------------------------------------------------------------------------------------------------------------------
[AiPlayer.java]
package core;
public class AiPlayer extends Player { //Here we group AiPlayer subclass to Player Superclass @Override public Card playCard(); @Override public int placeBid(); }
---------------------------------------------------------------------------------------------------------------------------------------
[Card.java]
package core;
import constants.Constants.Color; import constants.Constants.Face; import constants.Constants.Suit;
public class Card { private Face face; private Suit suit; private Color color; }
public Face getFace(){ return face; }
--------------------------------------------------------------------------------------------------------------------------------------
[Deck.java]
package core;
public class Deck { private Set
---------------------------------------------------------------------------------------------------------------------------------------
[Game.java]
package core;
import constants.Constants; import constants.Constants.Suit; import java.util.ArrayList; import java.util.Scanner;
public class Game { private Player dealer; private Player wonTrick; private int round; private ArrayList --------------------------------------------------------------------------------------------------------------------------------------- [HumanPlayer.java] package core; public class HumanPlayer extends Player{ //Here we group HumanPlayer subclass to Player Superclass @Override public Card playCard(); @Override public int placeBid(); } -------------------------------------------------------------------------------------------------------------------------------------- [IPlayer.java] package core; public interface IPlayer { public static void player(String[] args){ public Card playCard(); public int placeBid(); } } ---------------------------------------------------------------------------------------------------------------------------------------- [Player.java] package core; public abstract class Player implements IPlayer { //Here we implement IPlayer to abstract class of Player private String name; private int bid; private int score; private int tricks; public abstract Card playCard(); public abstract int placeBid(); public String getName(){ return name; } } ----------------------------------------------------------------------------------------------------------------------------------------- [Team.java] package core; import java.util.ArrayList; public class Team { private ArrayList ----------------------------------------------------------------------------- End of Code ------------------------------------------------------------------- 

![for each class. Your help is greatly appreciated. Thanks in advance! [Edited]](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e1dbb4dc88d_87666e1dbb450086.jpg)
![Below is the Java Code that I have so far: [Spades.java] package](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e1dbb5ea572_87766e1dbb54f009.jpg)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
