Question: You are trying to create a chessboard representation using the alphabetical uppercase letters O and X . The O ' s represent the lighter spaces
You are trying to create a chessboard representation using the alphabetical uppercase letters O and X The Os represent the lighter spaces while the Xs represent the darker spaces. Be careful NOT to use zero in your code!
Desired pattern:
OXOXOXOX
XOXOXOXO
OXOXOXOX
XOXOXOXO
OXOXOXOX
XOXOXOXO
OXOXOXOX
XOXOXOXO
public class LabChallenge
public static void mainString args
String chessboard new String;
add code below this line
add code above this line
for int row
; row chessboard.length; row
for int col ; col chessboardlength; col
if col chessboardlength
System.out.printlnchessboardrowcol;
else
System.out.printchessboardrowcol;
Requirement:
Your program cannot make any changes to the existing code in the program. If you do you will not earn any credit for this challenge. If you accidentally delete any existing code, you can copy the original code shown above back into your program.
Hint: It is probably much easier to use nested for loops in your code to populate the D array with either Os or Xs than to go through each row column index to modify the elements.
Thank you
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
