will you please edit my code so that after we read the files how to…
Question Answered step-by-step will you please edit my code so that after we read the files how to… will you please edit my code so that after we read the files how to printout the encoded and decoded files? READ THE CODES IN FROMTHE MORSECODETABLEFILEYou should pass thefilename into the objectvia the constructor (seemain method)Morsecodetable.txta .-b -…c -.-.d -..e .f ..-.g –.h ….i ..j .—k -.-l .-..m –n -.o —p .–.q –.-r .-.s …t -u ..-v …-w .–x -..-y -.–z –..0 —–1 .—-2 ..—3 …–4 ….-5 …..6 -….7 –…8 —..9 —-.. .-.-.-, –..–? ..–..: —…’ .—-.Quote2.txtThere are two major products that come out of Berkeley: LSD and UNIX. We don’t believe this to be a coincidence. Jeremy S. Anderson Quote2copy.txtthere are two major products that come out of berkeley: lsd and unix. we don’t believe this to be a coincidence. jeremy s. andersonQuote2morse.txt- …. . .-. . .- .-. . – .– — — .- .— — .-. .–. .-. — -.. ..- -.-. – … – …. .- – -.-. — — . — ..- – — ..-. -… . .-. -.- . .-.. . -.– —… .-.. … -.. //my codes//Converter.java public interface Converter {//public Converter(String encodingfile); << good idea/** * Prints a list of the key values pairs used to encode and decode strings. * */public void printKeyValuePairs();/** * Encodes a string based on the Key Value Pairs. * For Example if the encode file contained Morse code * the letter a would be replaced with .- wherever it was in the string * @param textToEncode the String to encode * @return returns the encoded version of the string */public String encode(String textToEncode);/** * Encodes a string based on the Key Value Pairs. * For Example if the encode file contained Morse code .- * it would be replaced with a wherever it was in the string * @param textToDecode the String to decode * @return returns the decode version of the string */public String decode(String textToDecode);//private boolean saveToFile(String textToSave, String saveToFile )/** * Encodes a string based on the Key Value Pairs. * For Example if the encode file contained Morse code .- * it would be replaced with a wherever it was in the string * @param textToDecode the String to decode * @param filename the file to save the decoded string in * @return returns true if the file is decoded and saved successfully */public boolean decodeSaveToFile(String decode, String filename );/** * Encodes a string based on the Key Value Pairs. * For Example if the encode file contained Morse code .- * it would be replaced with a wherever it was in the string * @param encode the String to encode * @param filename the file to save the encoded string in * @return returns true if the file is encoded and saved successfully */public boolean encodeSaveToFile(String encode, String filename );} // Main.java import java.io.BufferedReader;import java.io.FileNotFoundException;import java.io.FileReader;import java.io.IOException;public class Main {/** * @param args * @throws IOException */public static void main(String[] args) throws IOException { MorseConverter mc = new MorseConverter("MorseCodeTable.txt"); String workingDir = System.getProperty("user.dir") + "/"; mc.printKeyValuePairs(); String fileName = "Quote2.txt"; String copyfileName = "Quote2Copy.txt"; String saveFileName = "Quote2Morse.txt"; StringBuilder sb = new StringBuilder(); try (BufferedReader br = new BufferedReader(new FileReader(workingDir + fileName))) { String line = ""; while ((line = br.readLine()) != null) { sb.append(line); } }catch (FileNotFoundException e) { System.out.print(workingDir + fileName + " File Not found"); } catch (IOException e) { e.printStackTrace(); } mc.encodeSaveToFile(sb.toString(), workingDir + saveFileName); String encodeCopy = mc.encode(sb.toString()); mc.decodeSaveToFile(encodeCopy, workingDir + copyfileName); }} // MorseConverter.java import java.util.HashMap;import java.util.Map.Entry;import java.io.FileReader;import java.io.FileWriter;import java.io.IOException;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.FileNotFoundException;public class MorseConverter implements Converter{private HashMap


