public class Primes { public static boolean isPrime(int number) { int count, divs; divs=0; for(count=1 ; count<number; count++) { if (number%count==0) divs++; }//end for if (divs==2) return true; else return false; }//end of isPrime public static void main(String[] args) { int number, count; boolean test; TextIO.put("Please enter number to search up to. Primes will be dumped to a text file."); TextIO.writeFile("Primes.txt"); number = TextIO.getInt(); for(count=3; count <= number;count++) { test = isPrime(count); if (test==true) TextIO.putln(count); }//end for TextIO.writeStandardOutput(); TextIO.putln("Search complete,"); } // end of main() } // end of class Primes