Question: Write a java program that prompts the user to enter the center (x,y) coordinates, width, and height of two rectangles. Your program should then determine

Write a java program that prompts the user to enter the center (x,y) coordinates, width, and height of two rectangles.

Your program should then determine one of the following situations:

- The first rectangle is inside the second rectangle

- The second rectangle is inside the first rectangle

- The rectangles overlap (their boundaries cross each other)

- The rectangles do not touch each other, neither is inside of the another

Test your program to cover all cases.

You should return 4 screenshots of the output of your program run showing the values entered and the output of the program for 4 different input value set, each corresponding a different situation cited above. Your screenshots should be in one of the well-known picture formats, such as jpg or gif.

You should also send your java source code in a program code file with a name similar to your_surname.java.

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!