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...



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


         }


}


Lab Goal : This lab was designed to teach you how to use a Map.<br>Lab Description : Take list of people and to whom each person is related. Then, build a list for each<br>person and all of the people related to that person.<br>Files Needed ::<br>Sample Data :<br>Relatives.java<br>RelativesRunner.java<br>14<br>Jim Sally<br>relatives.dat<br>Fred Alice<br>Jim Tom<br>Jim Tammy<br>Bob John<br>algorithm help<br>Dot Fred<br>Dot Tom<br>Dot Chuck<br>This program must be written using a Map of Sets.<br>Bob Tom<br>Fred James<br>Timmy Amanda<br>private Map<String,Set<String>> map;<br>Almas Brian<br>The Map will store the key( person ) and a value(Set<br>of the people related to that person).<br>Elton Linh<br>Dot Jason<br>Dot<br>

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 Dot
A Bluel: Terminal Window - Maps<br>Options<br>Tammy is related to: Jim<br>James is related to: Fred<br>Alice is related to: Fred<br>John is related to: Bob<br>Dot is related to: Chuck Fred Jason Tom<br>Fred is related to: Alice Dot James<br>Amanda is related to: Timmy<br>Jim is related to: Sally Tammy Tom<br>Brian is related to: Almas<br>Almas is related to: Brian<br>Tom is related to: Bob Dot Jim<br>Elton is related to: Linh<br>Linh is related to: Elton<br>Sally is related to: Jim<br>Bob is related to: John Tom<br>Timmy is related to: Amanda<br>Chuck is related to: Dot<br>Jason is related to: Dot<br>

Extracted 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
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here