// Steve Gribble // 2/14/2006 // // This program will ask the user for the name of a file, and then it // will print (to the console) a version of the file that e e cummings // would have written -- i.e., all in lower case. import java.io.*; import java.util.*; public class EECummings { public static void main(String[] args) throws FileNotFoundException { // Ask the user for the file name to open Scanner console_in = new Scanner(System.in); System.out.print("File name: " ); String filename = console_in.next(); System.out.println(); // Now process the file, a line at a time Scanner file_in = new Scanner(new File(filename)); while (file_in.hasNextLine()) { String text = file_in.nextLine(); String lowertext = text.toLowerCase(); System.out.println(lowertext); } } }