Question: Hi ! I need help completing the interface methods in CompletedMain.java. The three methods that need to be completed are loadKanji ( String filename, EditableDiGraph
Hi I need help completing the interface methods in CompletedMain.java. The three methods that need to be completed are loadKanjiString filename, EditableDiGraph graph loadDataComponentsString filename, EditableDiGraph graph and buildOrderStringEditableDiGraph graph, TopologicalSort topSort, HashMap kanjiMap The first method should load datakanji.txt use it to populate a hashmap that maps IDs to characters, and add the IDs as nodes in the graph. The second method should load datacomponents.txt and use it to add edges to the graph. The third method should create an IntuitiveTopological object and use it to sort the graph and also display the characters in the ordering. The output contains only the kanji characters, no other formatting or spaces. Thank you so much for the help!
DO NOT USE ANY STAR IMPORTS OR PACKAGES OTHER THAN THE FOLLOWING:
java.ioBufferedReader
java.ioBufferedWriter
java.ioFile
java.ioFileInputStream
java.ioFileNotFoundException
java.ioFileOutputStream
java.ioFileReader
java.ioInputStreamReader
java.ioIOException
java.ioOutputStreamWriter
java.ioUnsupportedEncodingException
java.util.HashMap
java.util.LinkedList
java.util.NoSuchElementException
Here is the code provided in CompletedMain.java:
package edu.serm;
basic description of the program or class
Completion time: estimation of hours spent on this program
@author your name Acuna, Buckner
@version a version number or a date
Note: not all of these packages may be needed.
import java.ioBufferedReader;
import java.ioBufferedWriter;
import java.ioFile;
import java.ioFileInputStream;
import java.ioFileOutputStream;
import java.ioFileReader;
import java.ioInputStreamReader;
import java.ioIOException;
import java.ioOutputStreamWriter;
import java.util.HashMap;
public class CompletedMain implements KanjiMain
Do not add any member variables to this class.
TODO: implement interface methods.
public HashMap loadKanjiString filename, EditableDiGraph graph
throw new java.lang.UnsupportedOperationExceptionTODO;
public void loadDataComponentsString filename, EditableDiGraph graph
throw new java.lang.UnsupportedOperationExceptionTODO;
public String buildOrderStringEditableDiGraph graph, TopologicalSort topSort, HashMap kanjiMap
throw new java.lang.UnsupportedOperationExceptionTODO;
public static void mainString args
START CORE DRIVER LOGIC, DO NOT MODIFY
String FILENAMEKANJI "datakanji.txt;
String FILENAMECOMPONENTS "datacomponents.txt;
KanjiMain driver new CompletedMain;
EditableDiGraph graph new BetterDiGraph;
HashMap kanjiMap driver.loadKanjiFILENAMEKANJI, graph;
driver.loadDataComponentsFILENAMECOMPONENTS, graph;
TopologicalSort intuitive new IntuitiveTopologicalgraph;
System.out.printlndriverbuildOrderStringgraph intuitive, kanjiMap;
END CORE DRIVER LOGIC, DO NOT MODIFY
NOTE: feel free to temporarily comment out parts of the above code while
you incrementally develop your program. Just make sure all of it is there
when you test the final version of your program.
OPTIONAL: add code for extra credit here.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
