class Rectangle { int width, height; Point origin; public Rectangle(int initWidth, int initHeight, Point initOrigin) { width = initWidth; height = initHeight; origin = initOrigin; } public Rectangle(int initWidth, int initHeight, int originX, int originY) { width = initWidth; height = initHeight; origin = new Point(originX,originY); } void setWidth(int newWidth ) { width = newWidth; } int getWidth() { return width; } void setHeight(int newHeight ) { height = newHeight; } int getHeight() { return height; } void setOrigin(Point newOrigin) { origin = newOrigin; } Point getOrigin() { return origin; } int getArea() { return width * height; } // Move rectangle origin by dx,dy void moveOrigin(int dx, int dy) { origin.setX( origin.getX() + dx ); origin.setY( origin.getY() + dy ); } }