Advertisement

04.08.2008 at 01:09PM PDT, ID: 23306098
[x]
Attachment Details

Rectangle Class---intersection of two rectangles

Asked by robinlirb in New to Java Programming, Java Programming Language, Algorithms

Tags: ,

the question is like this:
wirte a class method intersction, that has two Rectangle parameters, the methods should return the rectangle formed by the area common to the two retangles. if they do not intersect, the method should reurn the rectangle whose instance fields are all zero. if the rectangles touch, the method should return a "rectangle" of zero width or zero lenght.

by the way, the class rectangle looks something like this
class Rectangle
{
private int left;         // x-coordinate of left edge
private int bottom;   // y-coordinate of left edge
private int width;
private int height;

public static Rectangle intersection(Rectnagle r)
{
???????   //  quesitons???
}Start Free Trial
[+][-]04.08.2008 at 01:15PM PDT, ID: 21309131

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 03:49PM PDT, ID: 21310329

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 04:09PM PDT, ID: 21310455

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 04:50PM PDT, ID: 21310677

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 11:06PM PDT, ID: 21312108

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: New to Java Programming, Java Programming Language, Algorithms
Tags: JAVA, RECTANGLE, INTERSECTION
Sign Up Now!
Solution Provided By: MicheleMarcon
Participating Experts: 3
Solution Grade: B
 
 
[+][-]04.09.2008 at 06:11AM PDT, ID: 21314459

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.09.2008 at 07:04AM PDT, ID: 21314960

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 06:27AM PDT, ID: 21358436

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628