SHOW:
|
|
- or go back to the newest paste.
| 1 | class Rectangle | |
| 2 | {
| |
| 3 | - | private double length; |
| 3 | + | public static string ShapeName |
| 4 | - | private double width; |
| 4 | + | |
| 5 | get { return "Rectangle"; }
| |
| 6 | - | public double Length |
| 6 | + | |
| 7 | private double length; | |
| 8 | - | get |
| 8 | + | private double width; |
| 9 | ||
| 10 | - | return length; |
| 10 | + | public double Length |
| 11 | {
| |
| 12 | - | set |
| 12 | + | get |
| 13 | {
| |
| 14 | - | if ( value > 0.0) |
| 14 | + | return length; |
| 15 | - | length = value; |
| 15 | + | } |
| 16 | set | |
| 17 | {
| |
| 18 | if ( value > 0.0) | |
| 19 | - | public double Width |
| 19 | + | length = value; |
| 20 | } | |
| 21 | - | get |
| 21 | + | |
| 22 | ||
| 23 | - | return width; |
| 23 | + | public double Width |
| 24 | {
| |
| 25 | - | set |
| 25 | + | get |
| 26 | {
| |
| 27 | - | if (value > 0.0 ) |
| 27 | + | return width; |
| 28 | - | width = value; |
| 28 | + | } |
| 29 | set | |
| 30 | {
| |
| 31 | if (value > 0.0 ) | |
| 32 | - | public double GetArea() |
| 32 | + | width = value; |
| 33 | } | |
| 34 | - | return length * width; |
| 34 | + | |
| 35 | ||
| 36 | public double GetArea() | |
| 37 | {
| |
| 38 | return length * width; | |
| 39 | } | |
| 40 | } | |
| 41 | } |