Rathod Nilam
please help me to find ans of this question,
Define the Rectangle class that contains:
Two double fields x and y that specify the center of the rectangle, the data field
width and height ,
A no-arg constructor that creates the default rectangle with (0,0) for (x,y) and 1
for both width and height.
07
2
A parameterized constructor creates a rectangle with the specified x,y,height
and width.
A method getArea() that returns the area of the rectangle.
A method getPerimeter() that returns the perimeter of the rectangle.
A method contains(double x, double y) that returns true if the specified point
(x,y) is inside this rectangle.
Write a test program that creates two rectangle objects. One with default values
and other with user specified values. Test all the methods of the class for both
the objects.
Define the Rectangle class that contains:
Two double fields x and y that specify the center of the rectangle, the data field
width and height ,
A no-arg constructor that creates the default rectangle with (0,0) for (x,y) and 1
for both width and height.
07
2
A parameterized constructor creates a rectangle with the specified x,y,height
and width.
A method getArea() that returns the area of the rectangle.
A method getPerimeter() that returns the perimeter of the rectangle.
A method contains(double x, double y) that returns true if the specified point
(x,y) is inside this rectangle.
Write a test program that creates two rectangle objects. One with default values
and other with user specified values. Test all the methods of the class for both
the objects.
Bhuro Patel
Joydip Panchal
Rathod Nilam