Question: Write a program class named SquareDisplay that asks the user to enter a positive odd number in the range 1 to 19. The program should

Write a program class named SquareDisplay that asks the user to enter a positive odd number in the range 1 to 19. The program should then display a square on the screen using the character X. The number entered by the user will be the length of each side of the square. For example, if the user enters 5, the program should display the following:

XXXXX

XXXXX

XXXXX

INPUT and PROMPTS The program prompts for an integer as follows: "Enter an integer in the range of 1-19: ".

OUTPUT The output should be a square of X characters as described above.

CLASS NAMES Your program class should be called SquareDisplay

* input validation: do not accept less than 0, greater than 20, and divided by zero.

Step by Step Solution

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 Databases Questions!