I've written some code (below). The program reads information from a file called “input.txt” and writes it to the terminal window. I want to the modify the program so that every full stop ‘.’ that is contained in “input.txt” is converted to an exclamation mark ‘!’ when the text is printed to the terminal window.
* Tests the result of trying to write to a file Reader.
* Also tests the result of trying to write to a random-access file
* that is opened only for reading.
public class OptionA
public static void main(String args)
FileReader reader = new FileReader("input.txt");
boolean done = false;
next = reader.read();
if (next == -1) done = true;
c = (char)next;
catch (IOException exception)
System.out.println("Error in processing file: " + exception);