aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913/Java/lab6/Polygon.java
diff options
context:
space:
mode:
Diffstat (limited to 'csci1913/Java/lab6/Polygon.java')
-rw-r--r--csci1913/Java/lab6/Polygon.java32
1 files changed, 0 insertions, 32 deletions
diff --git a/csci1913/Java/lab6/Polygon.java b/csci1913/Java/lab6/Polygon.java
deleted file mode 100644
index 7f025fe..0000000
--- a/csci1913/Java/lab6/Polygon.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package lab6;
-
-class Polygon
-{
- private int[] sideLengths;
-
- public Polygon(int sides, int ... lengths)
- {
- int index = 0;
- sideLengths = new int[sides];
- for (int length: lengths)
- {
- sideLengths[index] = length;
- index += 1;
- }
- }
-
- public int side(int number)
- {
- return sideLengths[number];
- }
-
- public int perimeter()
- {
- int total = 0;
- for (int index = 0; index < sideLengths.length; index += 1)
- {
- total += side(index);
- }
- return total;
- }
-}