コード例 #1
0
        static void Main(string[] args)
        {
            SalaryV1 s1;
            int money;

            s1 = new SalaryV1(new SalaryFormula());
            money = s1.Calculate(80,100,1);
            Console.WriteLine("Salary =>" + money);

            s1 = new SalaryV1(new SalaryFormula());
            money = s1.Calculate(80,100,1);
            Console.WriteLine("Salary =>" + money);

            s1 = new SalaryV1(new BossSalaryFormula());
            money = s1.Calculate(80,100,1);
            Console.WriteLine("Salary =>" + money);

            Console.ReadKey();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            SalaryV1 s1;
            int      money;

            s1    = new SalaryV1(new SalaryFormula());
            money = s1.Calculate(80, 100, 1);
            Console.WriteLine("Salary =>" + money);


            s1    = new SalaryV1(new SalaryFormula());
            money = s1.Calculate(80, 100, 1);
            Console.WriteLine("Salary =>" + money);


            s1    = new SalaryV1(new BossSalaryFormula());
            money = s1.Calculate(80, 100, 1);
            Console.WriteLine("Salary =>" + money);

            Console.ReadKey();
        }