-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRectangle
56 lines (45 loc) · 1.19 KB
/
Rectangle
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
45
46
47
48
49
50
51
52
53
54
55
56
//<Assignment7Project1> -- Rectangle
//CSIS 212-Module/Week 6
//<Citations> -- I used the book
public class Rectangle {
private double length = 1;
private double width = 1;
private double perimeter;
private double area;
//setters
public void setPerimeter(double perimeter){
this.perimeter = perimeter;
}
public void setArea(double area){
this.area = area;
}
public void setLength(double length){
if(length < 0.0 && length >20.0)
{
this.length = length;
}//end if
}//setLength
public void setWidth(double width){
if(width < 0.0 && width > 20.0)
{
this.width = width;
}//end if
}
//getters
public double getLength()
{
return length;
}
public double getWidth()
{
return width;
}
public double getPerimeter()
{
return perimeter;
}
public double getArea()
{
return area;
}
}