Question: java Complete the printTicTacToe method with char parameters horizChar and vertChar that prints a tic-tac-toe board with the characters as follows. End with newline. Ex:
java
Complete the printTicTacToe method with char parameters horizChar and vertChar that prints a tic-tac-toe board with the characters as follows. End with newline. Ex: printTicTacToe('~', '!') prints:
x!x!x ~~~~~ x!x!x ~~~~~ x!x!x
Hint: To ensure printing of characters, start your print statement as: System.out.println("" + horizChar ...).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import java.util.Scanner;
public class GameBoardPrinter {
public static void printTicTacToe(char horizChar, char vertChar) {
/* Your solution goes here */
return;
}
public static void main (String [] args) {
printTicTacToe('~', '!');
return;
}
}
code below:
import java.util.Scanner;
public class GameBoardPrinter { public static void printTicTacToe(char horizChar, char vertChar) {
/* Your solution goes here */
return; }
public static void main (String [] args) { printTicTacToe('~', '!');
return; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
