Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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****
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions