From: stephey Date: Fri, 2 Apr 2010 19:16:20 +0000 (+0000) Subject: Stephen's intro application added (not yet done) X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aeb0d6df8bae90ae116760640596cbcef4d0a059;p=IRC.git Stephen's intro application added (not yet done) --- diff --git a/Robust/src/Tests/mlp/stephen/test.java b/Robust/src/Tests/mlp/stephen/test.java index 8c78face..fd6d421f 100644 --- a/Robust/src/Tests/mlp/stephen/test.java +++ b/Robust/src/Tests/mlp/stephen/test.java @@ -1,18 +1,39 @@ -public class Test { +public class Test +{ + private final int MAX = 1000; + //Is needed because the default doesn't work that well... public Test(){} public static void main(String args[]) { - System.out.println("# it starts!!"); + System.out.println("# it starts"); Test t = new Test(); t.doSomeWork(); } - public void doSomeWork() { + public void doSomeWork() + { } + + public boolean isPrime(int num) + { + //Did abs this way because I didn't want to import Math + int number = (num >= 0) ? num:-num; + + if(number <= 1) + return false; + + for(int i = 2; i < number; i++) + { + if(number%i == 0) + return false; + } + + return true; + } }