using System.Collections.Generic;
public string LastName {get; set;}
public Name(string lastname)
public char Sex {get; set;}
public Name Name {get; set;}
public Gender Gender {get; set;}
public int Age {get; set;}
public void CommentOnAge()
string AgeInfo = "Infant";
Console.WriteLine(AgeInfo);
if ((Age = 1) && (Age < 3))
string AgeInfo = "Nurseryman";
Console.WriteLine(AgeInfo);
if ((Age = 3) && (Age < 7))
string AgeInfo ="Preschooler";
Console.WriteLine(AgeInfo);
if ((Age = 7) && (Age < 18))
string AgeInfo ="School child";
Console.WriteLine(AgeInfo);
public class Girl: Children
Gender gender = new Gender('F');
public void showGenderF()
Console.WriteLine("This child is a girl");
public class Boy: Children
Gender gender = new Gender('M');
public void showGenderW()
Console.WriteLine("This child is a boy");
public class Parents : Children
public string Position {get; set;}
public int Salary {get; set;}
public string WorkPlace {get; set;}
public Parents(string position, int salary, string workplace)
public void showInfoParents()
if (( Position == null) || (Salary == 0) || ( WorkPlace == null))
Console.WriteLine("Those parents are unemployed and need support");
Console.WriteLine("Workplace: "+ WorkPlace);
Console.WriteLine("Position: "+ Position);
Console.WriteLine("Salary: "+ Salary);
public class SingleMother : Children
public string Position {get; set;}
public int Salary {get; set;}
public bool hasFamiliAllowance {get; set;}
public SingleMother (string position,bool HasFamiliAllowance)
HasFamiliAllowance = hasFamiliAllowance;
public void showSingleMotherInfo()
Console.WriteLine("Position: "+ Position + "; Salary: " + Salary);
public void checkFamiliAllowance ()
Console.WriteLine("This Single Mother has Famili Allowance");
Console.WriteLine("This Single Mother doesn't have Famili Allowance and need support");
public class SingleFather : Children
public string Position {get; set;}
public int Salary {get; set;}
public bool HasFamiliAllowance {get; set;}
public SingleFather (string position, bool hasFamiliAllowance)
HasFamiliAllowance = hasFamiliAllowance;
public void showSingleFatherInfo()
Console.WriteLine("Position: "+ Position + "; Salary: " + Salary);
public void checkFamiliAllowance ()
Console.WriteLine("This Single Father has Famili Allowance");
Console.WriteLine("This Single Father doesn't have Famili Allowance and need support");
public class Orphan : Children
public string ChildCareHome {get; set;}
public string FosterFamily {get; set;}
public Orphan(string childCareHome, string fosterFamily)
ChildCareHome = childCareHome;
FosterFamily = fosterFamily;
public void checkChildCareHome ()
if ((ChildCareHome != null) && (FosterFamily == null))
Console.WriteLine("This child lives in Child Care Home.");
Console.WriteLine("This child lives with Foster Family.");
public static void Main()
Console.WriteLine("2 Years old child");
Children children = new Children();
Console.WriteLine("This parent is a cook");
Parents parents = new Parents ("Cook", 2000, "Restaurant");
parents.showInfoParents();
Console.WriteLine("This single mother doesn't need support");
SingleMother singleMother = new SingleMother ("Tester", "Yes");
singleMother.showSingleMotherInfo();
singleMother.checkFamiliAllowance();