Question: Write a Java program and upload Java source code which performs the following task: On a 1 0 1 0 grid, print the rectangles like

Write a Java program and upload Java source code which performs the following task:
On a 1010 grid, print the rectangles like in the examples below.
Take the top left coordinate and the size of two squares from user.
Squares should be represented with A and B characters.
Grid should be represented with * character.
If squares overlap, overlapping parts should be represented with c character.
If any of the rectangles exceed the limits, it should be cut.
Example 1:
Enter x. y for the square 1: 22
Enter size for the square 1; 3
Enter x, y for the square 2: 56
Enter size for the square 2:4
Output:
*****
******
******
*
**BBBB****
********BBBB****
********BBBB****
 Write a Java program and upload Java source code which performs

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!