From 39ea9759535b35c7df187e9d11e1372ee078420c Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Wed, 13 Nov 2019 10:43:15 -0600 Subject: Do lab 9, rearrange lab 6 stuff --- csci1913/Java/lab6/Polygon.java | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 csci1913/Java/lab6/Polygon.java (limited to 'csci1913/Java/lab6/Polygon.java') 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; - } -} -- cgit v1.2.3