Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA LANGUAGE!! public class ChessBoard { // Array of pieces values Rook, Knight, Bishop, King, Queen, Bishop, Knight, Rook static private final char []

IN JAVA LANGUAGE!!

image text in transcribed

public class ChessBoard { // Array of pieces values Rook, Knight, Bishop, King, Queen, Bishop, Knight, Rook static private final char [] WHITE_PIECES = { '\u2656', '\u2658', '\u2657', '\u2655', '\u2654', '\u2657', '\u2658', '\u2656' }; // unicode value of a pawn static private final char PAWN = '\u2659'; // our choice for "empty square" - medium rectangle ... static private final char EMPTY = '\u25AD'; private static final int ROWS = 8; private static final String HEADING = "----------------------------------------- " + " Unicode Symbols Chessboard " + "----------------------------------------- "; // Black piece values are equiv white pieces + 6 private static final int BLACK_PIECE_DISPLACEMENT = 6; static private void displayHeading() { System.out.println(HEADING); } private static void displayBoard() { for(int row = ROWS ; row >= 1 ; --row ) { System.out.printf("%-5d", row);

/** * COMPLETE LOGIC THAT DISPLAYS REST OF BOARD HERE */ System.out.println(""); // } } // Only Public Method Used Directly By main() static public void display() { displayHeading(); // display heading displayBoard(); } /** * @param args */ public static void main(String[] args) { // invoke display method ChessBoard.display(); } }

The output on the left is what you should get generated by the provided partially completed program. The output on the right is what your completed, to be submitted program should generate. Current-State Output Completed-State Output Unicode Symbols Chessboard UNICODE SYMBOLS CHESSBOARD ------------------------------- - - - - ** DHI i Norm and will O O O O 30 ml D D D O - OOO al - ODO O O O O OD 0 0 n ce o a ot 1. The heading to be upper-cased. 2. The chessboard lines 1-8 are to be filled in with the appropriate Unicode characters: a. Row 8 - black pieces: rook, knight, bishop, king, queen, bishop, knight, rook b. Row 7 - black pieces: 8 pawns C. Rows 6 through 3: 8 rectangles indicating empty squares d. Row 2 - white pieces: 8 pawns e. Row 1 - white pieces: rook, knight, bishop, king, queen, bishop, knight, rook

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

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago