here are the instructions for my assignment
Write a program that counts the number of words, lines and total characters (not including whitespace) in a paper, assuming that consecutive words are separated either by white space or end-of-line characters.
Your output from this particular file should say:
line count: 58 word count: 1673 character count: 7490(7492)
this is my code
import java.util.*;
import java.io.*;
public class Homework6 {
public static void main(String[] args)
throws FileNotFoundException {
Scanner input = new Scanner (new File("IHaveADream.txt"));
int linecount;
int wordcount;
int charactercount;
linecount = 0;
while (input.hasNextLine()) {
linecount++;
}
wordcount = 0;
while (input.hasNext()) {
wordcount++;
}
charactercount = 0;
while (input.hasNext()) {
charactercount++;
}
System.out.print( "line count: " + linecount + " word count: "+ wordcount + " character count:" + charactercount);
}
}
ok so when i compile there are no errors but it does not run any help please!!!