must be done in java provide the rest of the code with full comments and explanation 5152674
Must be done in Java.
Provide the rest of the code with full comments and explanation and with proper indentation.
Use simple methods for better understanding.
Must compile.
CODE PROVIDED:
import java.util.Scanner;
public class Problem1 {
public static void main( String [] args ) {
// Put your code below **************************
// Put your code above *************************
}
}
50 points! Complete this and you'll have passed! PROBLEM 1: A CHECKERED PAST Checkers is played on an N XN checker board, with one side playing the black pieces and the other side playing the white pieces. Given a board size N and the positions of the black and white checkers, create a program to print out the resulting checker board. INPUT Row, Column Integer N denoting the size of the board Integer B denoting the number of black pieces to be placed on the board, followed by B pairs of integers R C denoting the row and column of B black pieces Sample Input N Integer W denoting the number of white pieces to be placed on the board, followed by W pairs of integers R C denoting the row and column of W white pieces 4 3 2 1 1 1 3 2 2 3 3 W PROCESSING: The bottom left corner of the board is (0, o) and the top right corner is (N-1,N-1) (4,0) Sample Output 2 0 |(4,4) …0 OUTPUT 0. Output an Nx N board, where an empty square is denoted by a period ., a black piece is denoted by an asterisk *', and a white piece is denoted by the letter o' 0 2 (0,0 |(0,4) ArrayList in Java ArrayList is a class in the java.util package used for lists. To create an ArrayList that stores String, we use the following ArrayList list Scanner class Scanner is a class in the java. util package Used for obtaining the inpuf of both integers and strings (amongst other types). To create an object of the Scanner class that uses the standard input stream, we use the following: Scanner stdin new Scanner (System. in ) ; With the Scanner class objects, we can use the following methods: new ArrayList ( ) ; With the ArrayList object we can use the following methods: Method Description Description Method Appends the element o to the 1ist.add (o) Returns true if there is a token end of this list. stdin.hasNext () ready in the scanner's input. (1+ nonwhitespace characters) Returns the element at the list.get (i) specified position in this list. Returns true if the next token Returns true if this list contains the specified element. list.contains (o) stdin.hasNext Int () in the scanner's input can be interpreted as an int value Returns the number of elements list.size) Finds and returns the next in this list stdin.next() token from this scanner For loop: Scans the next token of the input as an int. stdin.next Int() To iterate over values 0… n for (int i= 0; i