class CapFile { public CapFile (TextReader inFile, TextWriter outFile) { char letter; letter = inFile.readAnyChar(); while (!inFile.eof()) { if ('a' <= letter && letter <= 'z') letter -= 32; outFile.print(letter); letter = inFile.readAnyChar(); } outFile.close(); } public static void main (String[] args) { TextReader inFile = new TextReader("cities.txt"); TextWriter outFile = new TextWriter("after.txt"); CapFile capFile = new CapFile(inFile, outFile); } }