(This exercise should be used in conjunction with Exercises 1 and 2.) Write a definition for a
RectangleDriverclass with a
mainmethod to do the following: Instantiate a
Pointnamed
topLeftat x = −3.0 and y = 1.0. Instantiate a
Pointnamed
bottomRightat x = 3.0 and y = −1.0. Instantiate a
Rectanglenamed
rectangleusing
topLeftand
bottomRightas arguments. Call
rectangle’s printCentermethod. Use a single chained statement to shift the rectangle right by one and then up by one. Call
rectangle’s printCentermethod again. The output should be:
x = 0.0 y = 0.0x = 1.0 y = 1.0
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.