i need someone to do this program for me
and before saying that i have to do my homework alone
i had midterms all week and in about in hour or so and i forgot about this assignment and i just dont have time so plz help here it is ( its due in two hours )
1. Has 2 private fields x and y of type int. 2. Has 2 constructors: a default constructor that sets the coordinates to (0, 0), and a
constructor that takes two parameters to set (x, y). 3. Has five methods:
moveUp(int units): moves the point up an amount equal to units. moveDown(int units): moves the point down an amount equal to units. moveLeft(int units): moves the point left an amount equal to units. moveRight(int units): moves the point right an amount equal to units. printPoint(): prints a description of the point as (x,y)
1. Has 5 private fields: width, height, area, circumference all of type int, and center of type Point.
2. Has 2 constructors: a default constructor that sets the center to the point (0, 0), and the width and height to 1. The second constructor takes 3 parameters to set the width, height, and the center. Both constructors calculate the area and circumference.
3. Has 4 methods: setWidth(int w): sets the width of the rectangle to w. setHeight(int h): sets the height if the rectangle to h.
move(int direction, int unit): moves the rectangle in a direction passed as a parameter, an amount equal to unit. direction is an int that could have one of four values (0, 1, 2, 3) where 0 means up, 1 means right, 2 means down, and 3 means left.
printRectangle(): prints a description of every rectangle including its width, height, center, area, and circumference.
1. It has one method which is the main() method. In the main, program the following scenario:
Instantiate a rectangle using the default constructor Print its details Change its width to 2 Move it right 3 units
Print its details again Instantiate a second rectangle with width 3, height 5, and center (1, 4). Print its details Move it up 2 units Change its height to 2 Print its details again