From aeb0d6df8bae90ae116760640596cbcef4d0a059 Mon Sep 17 00:00:00 2001 From: stephey Date: Fri, 2 Apr 2010 19:16:20 +0000 Subject: [PATCH] Stephen's intro application added (not yet done) --- Robust/src/Tests/mlp/stephen/test.java | 27 +++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) 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; + } } -- 2.34.1