-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle1.java
More file actions
39 lines (34 loc) · 767 Bytes
/
Copy pathRectangle1.java
File metadata and controls
39 lines (34 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public class Rectangle1 extends GeometricObject1{
private double width;
private double height;
public Rectangle1() {
}
public Rectangle1(double width,double height) {
this.width=width;
this.height=height;
}
public Rectangle1(double width,double height,String color,boolean filled) {
this.width=width;
this.height=height;
setColor(color);
setFilled(filled);
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width=width;
}
public double geiHeight() {
return height;
}
public void setHeight(double height) {
this.height=height;
}
public double getArea() {
return width*height;
}
public double getPerimeter() {
return 2*(width+height);
}
}