/* * File: FindPrimes.java * --------------------- * This program finds all prime numbers between the constants * LOWER_BOUND and UPPER_BOUND. */ import acm.program.*; public class FindPrimes extends ConsoleProgram { public void run() { for (int i = LOWER_BOUND; i <= UPPER_BOUND; i++) { if (isPrime(i)) println(i); } } /* Method: isPrime */ /* Returns true if *n* is a prime number */ private boolean isPrime(int n) { } /* Lower and upper bound constants */ private static final int LOWER_BOUND = 1; private static final int UPPER_BOUND = 100; }