Design and implement a Rectangle class. Make your class inherit from the Point c
ID: 1935723 • Letter: D
Question
Design and implement a Rectangle class. Make your class inherit from the Point class given in the lecture (notice that a rectangle can be described through the upper-left vertex, the height, and the width). Include acccesors, mutators, constructors, a method to display the information of the rectangle, and an area method. Write a Main class to test your Rectangle class. public class Point { private double x; private double y; public Point() { x = y = 0; } public Point(double x1, double y1) { x = x1; y = y1; } public double getX() { return x; } public double getY() { return y; } public void setX(double d) { x = d; } public void setY(double d) { y = d; } public String toString() { return " (" + x + ", " + y + ") " ; } public Point copy() { return new Point(x, y); } public double area() { return 0; } }Explanation / Answer
please go to this link. http://www.studentoffortune.com/question/1755842/ECET370-lab1
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.