Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started