Class of Rectangles
int x,y,width,height;
move(int,int)
resize(float)
print()
class Rectangle {
int x,y,width,height;
public Rectangle(int x, int y, int width, int height){
this.x = x; this.y = y;
this.width = width; this.height = height;
}
public void move(int x, int y){
this.x = x;
this.y = y;
}
public void resize(int float){
width = (int)(ratio*width) ;
height = (int)(ratio*height);
}
...
}
Previous slide
Next slide
Back to first slide
View graphic version