Question: Write a program that prints the following grid to play tic-tac-toe. You should do it the smart way, though. Declare string variables to hold two

Write a program that prints the following grid to play tic-tac-toe.

| | | | +--+--+--+ +-+-+-+ Of course, you could simply write

You should do it the smart way, though. Declare string variables to hold two kinds of patterns: a comb-shaped pattern and the bottom line. Print the comb three times and the bottom line once.

| | | | +--+--+--+ +-+-+-+ Of course, you could simply write seven statements of the form System.out.println("+--+--+--+");

Step by Step Solution

3.25 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!