static void Main(string[] args) { EasyCleaning easyClean = new EasyCleaning(); UsualCleaning usualClean = new UsualCleaning(); GeneralCleaning generalClean = new GeneralCleaning(); HouseKeeper hk = new HouseKeeper(2); if (hk.Time < 1) { hk.cleaning = easyClean; } else if (hk.Time > 6) { hk.cleaning = generalClean; } else { hk.cleaning = usualClean; } hk.Request(); Console.ReadKey(); }
public override void DoWork(HouseKeeper woman) { Console.WriteLine("Wet cleaning, washing windows"); }
public override void DoWork(HouseKeeper woman) { Console.WriteLine("Fold things, sweep the floor"); }
public override void DoWork(HouseKeeper woman) { Console.WriteLine("Wipe off dust, use a vacuum cleaner"); }
public abstract void DoWork(HouseKeeper woman);