Exercise
n     // Java Examples in a Nutshell, p. 12
n     // Rewrite this program using iterators with no “for” or “%”
n     public class FizzBuzz {
n         public static void main(String[] args) {
n         for (int i=1;i<=100;i++) {
n             if ((i%5)==0 && (i%7)==0)
n                 System.out.print(“fizzbuzz”);
n             else if ((i%5)==0)
n                 System.out.print(“fizz”);
n             else if ((i%7)==0)
n                 System.out.print(“buzz”);
n             else
n                 System.out.print(i);
n             System.out.print(“ “);
n         }
n         System.out.println();
n     }
n }
Here is an example program found in a published book that desperately needs some iterators.  If you ever wonder why your computer is so slow, you might guess that it is trying to divide every single number nearly twice by both five and seven.  I’d like to see who can come up with a better way and maybe we can offer a prize for the best solution.