public class Sum_for
{
  public static void main(String args[])
  {

    TokenReader in = new TokenReader(System.in);

    int    count = 0; // major diff in count here from "while" version
    int    stop  = 0;
    double sum   = 0;
    double temp  = 0;    

    System.out.print("How many numbers do you wish to enter? ");
    System.out.flush();
    stop = in.readInt();

    for(count = 1; count <= stop; ++count) {
      System.out.print("Enter data #" + count + ": ");
      System.out.flush();
      temp = in.readDouble();
      sum = temp + sum;
    }
    
    System.out.println();
    System.out.println("Final sum: " + sum);
  }
}
