Complete the following file:

Counter.java

import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Counter { private File inputFile; public Counter(File inputFile) { this.inputFile = inputFile; } public int countLines() { int count = 0; /*** complete this method ***/ return count; } public int countWords() { int count = 0; /*** complete this method ***/ return count; } public int countChars() { int count = 0; /*** complete this method ***/ return count; } }

Use the following file:

CounterTester.java

import java.io.File;

public class CounterTester
{
    public static void main(String args[])
    {
        File inputFile = new File("GettysburgAddress.txt");
        Counter counter = new Counter(inputFile);
        
        int lineCount = counter.countLines();
        System.out.println("Line count: " + lineCount);
        System.out.println("Expected: 25");
        
        int wordCount = counter.countWords();
        System.out.println("Word count: " + wordCount);
        System.out.println("Expected: 267");
        
        int charCount = counter.countChars();
        System.out.println("Character count: " + charCount);
        System.out.println("Expected: 1459");
    }
}