Question: Write two programs: MyRectangle.java which contains the definition of MyRectangle class, and MyPoint. java which contains the definition of MyPoint class. You should include additional

 Write two programs: MyRectangle.java which contains the definition of MyRectangle class,

Write two programs: MyRectangle.java which contains the definition of MyRectangle class, and MyPoint. java which contains the definition of MyPoint class. You should include additional methods (setter and getter) that are useful for the application class Lab5.java. Lab5.java public class Lab5 \{ public static void main (String []args ) { Point originOne = new Point (10,20); Rectangle rectOne = new Rectangle(originOne, 100, 200); System.out.println ("The rectangle area is "+rectOne.getArea()); rectOne.move (30,40); System.out.println ("The rectangle moved to a new poine, "+ " new X value is "+ originOne.get X()+ " and new Y value is "+ originOne.get Y()); \} Sample run: The rectangle area is 20000 The rectangle moved to a new poine, new X value is 30 and new Y value is 40 Press any key to continue

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!