import java.io.IOException; public class WordLengths { public static void main( String[] args ) throws IOException { Play document = new Play( args[0] ); int maximum = Integer.parseInt( args[1] ); for (int i = 1; i <= maximum; i++) { System.out.println( "The play in the file " + args[0] + " contains " + document.wordsOfLength( i ) + " words of " + i + " characters." ); } } }