Please do this in JAVA PROGRAMMING
Note: The attached images are the instructions and the target output
relatives.dat file in text:
14
Jim Sally
Fred Alice
Jim Tom
Jim Tammy
Bob John
Dot Fred
Dot Tom
Dot Chuck
Bob Tom
Fred James
Timmy Amanda
Almas Brian
Elton Linh
Dot Jason
Dot
Relatives.java reference file:
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Scanner;
import static java.lang.System.*;
public class Relatives
{
private Map<>> map; public Relatives() { } public void setPersonRelative(String line) { String[] personRelative = line.split(" "); } public String getRelatives(String person) { return ""; } public String toString() { String output=""; return output; }}RelativesRunner.java reference file:import java.io.File;import java.io.IOException;import java.util.Scanner;import static java.lang.System.*;public class RelativesRunner{ public static void main( String args[] ) throws IOException { //add more test cases }}Extracted text: Lab Goal : This lab was designed to teach you how to use a Map. Lab Description : Take list of people and to whom each person is related. Then, build a list for each person and all of the people related to that person. Files Needed :: Sample Data : Relatives.java RelativesRunner.java 14 Jim Sally relatives.dat Fred Alice Jim Tom Jim Tammy Bob John algorithm help Dot Fred Dot Tom Dot Chuck This program must be written using a Map of Sets. Bob Tom Fred James Timmy Amanda private Map<>> map; Almas Brian The Map will store the key( person ) and a value(Set of the people related to that person). Elton Linh Dot Jason DotExtracted text: A Bluel: Terminal Window - Maps Options Tammy is related to: Jim James is related to: Fred Alice is related to: Fred John is related to: Bob Dot is related to: Chuck Fred Jason Tom Fred is related to: Alice Dot James Amanda is related to: Timmy Jim is related to: Sally Tammy Tom Brian is related to: Almas Almas is related to: Brian Tom is related to: Bob Dot Jim Elton is related to: Linh Linh is related to: Elton Sally is related to: Jim Bob is related to: John Tom Timmy is related to: Amanda Chuck is related to: Dot Jason is related to: Dot
public Relatives()
}
public void setPersonRelative(String line)
String[] personRelative = line.split(" ");
public String getRelatives(String person)
return "";
public String toString()
String output="";
return output;
RelativesRunner.java reference file:
import java.io.File;
import java.io.IOException;
public class RelativesRunner
public static void main( String args[] ) throws IOException
//add more test cases
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here