I have a nearly finished program. Only problem is when the user enters "exit" to kill the program, the word "exit" is written to the file "quotes.txt" at the end. How do I get the program to check for "exit" first and not write it into "quotes.txt"?Here is the code:\[code\]public static void main(String[] args) throws IOException { final Formatter fo; BufferedWriter bw = null; BufferedReader in = new BufferedReader(new FileReader("quotes.txt")); String input = ""; String line; File quotesFile = new File("quotes.txt"); if (quotesFile.exists()) { System.out.println(quotesFile.getName() + " exists."); } else { System.out.println("THIS DOES NOT EXIST."); } try { fo = new Formatter("quotes.txt"); System.out.println("File created or found."); } catch (Exception e) { System.out.println("You have an error."); } do { try { Scanner kb = new Scanner(System.in); if (!input.equalsIgnoreCase("exit")) { System.out.println("Enter your text(Type 'exit' to close program.): "); bw = new BufferedWriter(new FileWriter(quotesFile, true)); input = kb.nextLine(); bw.write(input); bw.newLine(); bw.close(); System.out.println("Entry added.\n"); } } catch (Exception e) { System.out.println("Error."); } } while (!input.equalsIgnoreCase("exit")); System.out.println("Results: "); while ((line = in.readLine()) != null) { System.out.println(line); }}}\[/code\]