Stephen's intro application added (not yet done)
authorstephey <stephey>
Fri, 2 Apr 2010 19:16:20 +0000 (19:16 +0000)
committerstephey <stephey>
Fri, 2 Apr 2010 19:16:20 +0000 (19:16 +0000)
Robust/src/Tests/mlp/stephen/test.java

index 8c78faceeb4513e128b0ec256d1df83d768bcfc6..fd6d421f86703c7e346d51d00775a33d1100cddf 100644 (file)
@@ -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;
+    }
    
 }