460 -Overlapping Rectangles

When displaying a collection of rectangular windows on a SUN screen, a critical step is determining whether two windows overlap, and, if so, where on the screen the overlapping region lies. Write a program to perform this function. Your program will accept as input the coordinates of two rectangular windows. If the windows do not overlap, your program should produce a message to that effect. If they do overlap, you should compute the coordinates of the overlapping region (which must itself be a rectangle). All coordinates are expressed in “pixel numbers”, integer values ranging from 0 to 9999. A rectangle will be described by two pairs of (X, Y ) coordinates. The first pair gives the coordinates of the lower left-hand corner (XLL, YLL). The second pair gives the coordinates of the upper right-hand coordinates (XUR, YUR). You are guaranteed that XLL < XUR and YLL < YUR.

Read more…(148 words)

About the author:

Juan Vargas

Loading…

Join the discussion. Add a reply…

Post

About the author

Juan Vargas

Ready to join our community?

Sign up below to automatically get notified of new lists, get **reminders** to finish ones you subscribe to, and **bookmark** articles to read later.

Continue with Facebook

— OR —

Your Full Name

Email address

I have an account. Log in instead

By signing up, you agree to our Terms and our Privacy Policy.