====== ChessSquares class ======
----
Topics: Strings, Input, Selection (if-else)
Each square on a chess board can be described by a letter and number:
{{ http://rockhopper.monmouth.edu/~jchung/images/chessboard.png }}
The following pseudocode describes an algorithm that determines whether a square with a given letter and number is dark or light.
If the letter is a, c, e, or g
If the number is odd
color = "dark"
Else
color = "light"
Else
If the number is even
color = "dark"
Else
color = "light"
===== ChessSquares =====
Write ''ChessSquares.java'' to input a letter and number and output whether the specified square is dark or light.
Assume that the variables letter and color are of the String type. Assume that the number variable is of int type. Use only String and int types for this program.
Sample input/output:
Input the square's letter:
a
Input the square's number:
5
That square's color is: dark
===== ChessSquares2 =====
In //ChessSquares2.java//, use a method called //getSquareColor// that returns a square color based on a square letter and square number that is passed as input to //getSquareColor//. The same input/output must be the same as //ChessSquares.java//.
----
[[https://piazza.com/class_profile/get_resource/hzkswvpxv2r2nu/i1u6ttsaxwb717|Link to ChessSquares.java]]
[[https://piazza.com/class_profile/get_resource/hzkswvpxv2r2nu/i1u6tzhaitrs5|Link to ChessSquares2.java]]
----