示例#1
0
        static void Main(string[] args)
        {
            ScoringAlgorithm algorithm;

            Console.WriteLine("Men");
            algorithm = new MensScoringAlgorithm();
            Console.WriteLine(algorithm.GenerateScore(10, new TimeSpan(0, 2, 34)));
            Console.WriteLine("Women");
            algorithm = new WomenScoringAlgorithm();
            Console.WriteLine(algorithm.GenerateScore(10, new TimeSpan(0, 2, 34)));

            Console.WriteLine("Children");
            algorithm = new ChildrensScoringAlgorithm();
            Console.WriteLine(algorithm.GenerateScore(10, new TimeSpan(0, 2, 34)));
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            ScoringAlgoritm algoritm;

            Console.Write("Mans : ");
            algoritm = new MensScoringAlgorithm();
            Console.WriteLine(algoritm.GenerateScore(8, new TimeSpan(0, 2, 20)));

            Console.Write("Woman : ");
            algoritm = new WomanScoringAlgorithm();
            Console.WriteLine(algoritm.GenerateScore(8, new TimeSpan(0, 2, 20)));

            Console.Write("Children : ");
            algoritm = new ChildrenScoringAlgorithm();
            Console.WriteLine(algoritm.GenerateScore(8, new TimeSpan(0, 2, 20)));

            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            //sık kullanılır
            //bir metot içerisindeki farklı operasyonların bir şablon oluşturulup soyutlanması ve o soyuta somutların atanması işlemidir.
            ScoringAlgorithm algorithm;

            Console.WriteLine("Mans");
            algorithm = new MensScoringAlgorithm();
            Console.WriteLine(algorithm.GenerateScore(8, new TimeSpan(0, 2, 34)));

            Console.WriteLine("Women");
            algorithm = new WomenScoringAlgorithm();
            Console.WriteLine(algorithm.GenerateScore(8, new TimeSpan(0, 2, 34)));

            Console.WriteLine("Children");
            algorithm = new ChildrenScoringAlgorithm();
            Console.WriteLine(algorithm.GenerateScore(8, new TimeSpan(0, 2, 34)));


            Console.ReadLine();
        }