Search:

Type: Posts; User: TimoElPrimo

Search: Search took 0.32 seconds.

  1. Replies
    17
    Views
    4,608

    Re: Counting Words in a File with a Loop

    not sure what u trying to do, but u need something like this.

    public static void main(String[] args) throws FileNotFoundException{
    Scanner inFile = new Scanner(new FileReader("File")); // reads...
  2. Replies
    17
    Views
    4,608

    Re: Counting Words in a File with a Loop

    SOLVE. LOL
    general form is
    sum=o;// initialized
    while ( condition)
    {
    ...
    sum= sum + num; // update the sum.
    count++ // keeps a count.
    ...
    }// end while loop
Results 1 to 2 of 2