Question: IN JAVA COMPLETE THE PROGRAM You are going to write a program that checks chess moves for legality and display possible moves a chess piece

IN JAVA COMPLETE THE PROGRAM
You are going to write a program that checks chess moves for legality and display possible moves a chess piece might make. You will start by writing an abstract parent for all of our different chess pieces called
ChessPiece. Then you will write Knight, WhitePawn, Rook, Bishop, and Queen classes. I have
provided a King class as an example and a BlackPiece class (which is used as a dummy class for
all black pieces). We will only test with white pieces. I have also provided a Board class and a
ChessMoveChecker program class for you.
The abstract ChessPiece Class
This class must have exactly the following protected instance variables (attributes/fields):
rowNum: an integer specifying the row of the board the piece is on
columnNum: an integer specifying the column of the board the piece is on
pieceColor: an integer specifying the color of the piece (using a constant from Board)
This class must have at least the following public methods. You may wish to add additional
protected methods that have logic needed by multiple subclasses:
A constructor that takes in values for all three instance variables.
A move method that takes the new row and column as parameters and updates the
pieces location instance variables.
A getColor method that returns pieceColor.
An abstract getLabel method that returns a character and takes no parameters.
An abstract isLegalMove method that returns a boolean and takes three parameters: an
integer destRow representing the destination row, an integer destCol representing the
destination column, and a Board object theBoard, which is the chess board were using.
An abstract generateLegalMoves void method that takes two parameters: a 2D array of
characters boardData that we will use for showing where the piece can move and a
Board object theBoard.
You will then create the following subclasses of ChessPiece. I highly recommend doing them in
this order.
Knight
Rook
WhitePawn (because pawns move in only one direction, the different colors behave
differently, unlike other pieces)
Bishop
Queen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!