forked from Denisolt/CSCI-160
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle.java
More file actions
44 lines (40 loc) · 885 Bytes
/
Rectangle.java
File metadata and controls
44 lines (40 loc) · 885 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
40
41
42
43
44
//Denisolt Shakhbulatov
//10.22.2015
/* ______________________________
* + Rectangle +
* +____________________________+
* + -width:double +
* + -length:double +
* +____________________________+
* + +setLength(len:double):void+
* + +setWidth(w:double):void +
* + +getLength():double +
* + +getWidth():double +
* + +getArea():double +
* +____________________________+
*/
public class Rectangle
{
private double length;
private double width;
public void setLength(double len)
{
length = len;
}
public void setWidth(double w)
{
width = w;
}
public double getLength(double len)
{
return length;
}
public double getWidth(double w)
{
return width;
}
public double getArea()
{
return length*width;
}
}