You need to give your “Person” a couple attributes
either bool isBoy or string(Enum?) Gender
as well as float bodyWeight or similar.
Then you need to make a list of Person, and get the Average of each persons bodyWeight
you can also search through this list to find where the person isBoy or gender matches boy or girl
solved How do I use a class parents and children? [closed]