From 175721a63b426355274fa9e8063f762020ab8362 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Thu, 30 Jan 2020 16:55:04 -0600 Subject: R E A R R A N G E --- OLD/csci1913/Java/lab5_strap012.java | 90 ++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 OLD/csci1913/Java/lab5_strap012.java (limited to 'OLD/csci1913/Java/lab5_strap012.java') diff --git a/OLD/csci1913/Java/lab5_strap012.java b/OLD/csci1913/Java/lab5_strap012.java new file mode 100644 index 0000000..45a101b --- /dev/null +++ b/OLD/csci1913/Java/lab5_strap012.java @@ -0,0 +1,90 @@ +// +// SIEVE. The Sieve of Eratosthenes. +// +// James B. Moen +// 08 Oct 19 +// +// Test the SIEVE class, for 30 points total. +// + +// +// Put your code for the class SIEVE here!!! +// +class Sieve { + private boolean[] numbers; + private int realMax; + public Sieve(int max){ + if (max<2) + throw new IllegalArgumentException(); + numbers = new boolean[max]; + realMax = (max - 1); + for (int i=2; i