Posts

Showing posts from August, 2021

Strategy_Pattern

 namespace WindowsFormsApp {     public interface IEmployeeSal     {          float GetSalary(int basic,float dividend,float commission);     } } namespace WindowsFormsApp {     public class HRDeptSalary : IEmployeeSal     {        // @Override          public float GetSalary(int basic, float dividend, float commission)         {             return basic + dividend+commission;         }     }     public class SalesDept : IEmployeeSal     {         // @Override          public float GetSalary(int basic, float dividend, float commission)         {             return basic + dividend+commission;         }     }     public class PurchaseDept : IEmployeeSal     {         // @Override          public float GetSalary(int basic, float dividend, float commission)         {             return basic + dividend;         }     } } namespace WindowsFormsApp {     public class EmployeeSalary     {         public string EmployeeName { get; set; }         public int Basic { get; set; }         private