This application models the family tree of King Arthur. The application supports two operations,
- Adding a child to any family through the mother
- Get relations of a member
Supported relationships are,
- Son
- Daughter
- Siblings
- Brother-In-Law
- Sister-In-Law
- Maternal-Aunt
- Paternal-Aunt
- Maternal-Uncle
- Paternal-Uncle
Input is a text file with a set of operations where each line contains a single operation.
Sample input content:
ADD_CHILD Flora Minerva Female
GET_RELATIONSHIP Remus Maternal-Aunt
GET_RELATIONSHIP Minerva Siblings
ADD_CHILD Luna Lola Female
Path of the input file should be passes as the only argument to the application. The output will be printed to the standard output.
- Only Female family members who have a spouse can have children. (There are no single mothers)
- In-laws include all spouses of their siblings. For example, Audrey's brother in laws are Bill, Charlie, Ronald and Harry
- Change directory to
geektrust-familytree
- Run
mvn clean install
After running the above command, a JAR file geektrust.jar
will be generated in geektrust-familytree/target
directory.
To run the application navigate to the geektrust-familytree/target
and run the following command.
java -jar geektrust.jar <input_file_path>