- Home
- Course
- Geometric shapes
- Square

Saturday, November 11, 2023
⁃
Difficulty:
Easy

Write a Java program that prompts the user for two integers. The first number `x`

is used to draw the square on the screen, the next `width`

is the total width of the square.

Use the values to draw a square of the indicated proportions.

0 8

000000000000000000000000 000000000000000000000000 000000000000000000000000 000000000000000000000000 000000000000000000000000 000000000000000000000000 000000000000000000000000 000000000000000000000000

Share it on your social media and challenge your friends to solve programming problems. Together, we can learn and grow.

The code has been successfully copied to the clipboard.

Continue improving your Java programming skills with our selection of practical exercises from the lesson. Click on Practice and challenge your knowledge!

Practice with exercises in Java to create geometric shapes of different types.