Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java8 programming,ArrayList,List,recursion,tree, please explain in detail You will need to create two classes, Family Tree and FamilyMember. The objective of the Family- Member class is

Java8 programming,ArrayList,List,recursion,tree, please explain in detail

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

You will need to create two classes, Family Tree and FamilyMember. The objective of the Family- Member class is to represent a person within a family tree. Use the following scaffold as part of your solution. import java.util.List; import java.util.ArrayList; public class FamilyMember { private String name; private int age; private List children; //Rest of your code here import java.util.List; public class FamilyTree { private FamilyMember headofFamily; public FamilyTree (FamilyMember headOfFamily) { this.headofFamily = headofFamily; public List getAll() { //Your code here public List getParents() { //Your code here public List get Childless () { ///Your code here public List getUnclesAndAunties () { //Your code here public static void main(String[] args) { //Test your code here Consider the following family tree: Jeremy Meredith Sarah Kelly James Fred David Fiona After implementing the FamilyTree and FamilyMember classes, implement the following queries Write a method public List getAll() which will retrieve all fam- ily members that are part of the family tree. Write a method public List getAllParents () which will re- trieve all family members that have children, after writing getAllParents, write the inverse that will find all Family Member's that do not have a child. Difficult: Write a method public List get UnclesAndAunties (). which will find all uncles and aunties

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions