Write a full java code with input out example in OOP style that does the following: Given below is a Rectangle class consisting of an upper left coordinate and a lower right coordinate. class...


Write a
full java code with input out example
in OOP style that does the following:



Given below is a Rectangle class consisting of an upper left coordinate and a lower right coordinate.


class Rectangle { int upperLeftX; int upperLeftY; int lowerRightX; int lowerRightY; }


Since the upper left coordinate and lower right coordinate comprise of points, how would you modify the definition of the Rectangle class to include these points in your class?


write a complete java code to do this , not only the classes.


Hint: You can create a Point class to store the x and y coordinates of the upper left and lower right points and use composition to include the upper left and lower right points inside the Rectangle class, as objects of the Point class.



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here