Answered step by step
Verified Expert Solution
Link Copied!
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

image text in transcribed

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

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students explore these related Databases questions