Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Programmer freelancer = new FreelanceProgrammer(new CPPLanguage());

            freelancer.DoWork();
            freelancer.EarnMoney();

            freelancer.Language = new CSharpLanguage();
            freelancer.DoWork();
            freelancer.EarnMoney();

            Console.Read();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // создаем нового программиста, он работает с с++
            Programmer freelancer = new FreelanceProgrammer(new CPPLanguage());
            freelancer.DoWork();
            freelancer.EarnMoney();
            // пришел новый заказ, но теперь нужен c#
            freelancer.Language = new CSharpLanguage();
            freelancer.DoWork();
            freelancer.EarnMoney();

            Console.Read();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Programmer freelancer = new FreelanceProgrammer(new CppLanguage());

            freelancer.DoWork();
            freelancer.EarnMoney();
            // пришел новый заказ, но теперь нужен c#
            freelancer.Language = new CsharpLanguage();
            freelancer.DoWork();
            freelancer.EarnMoney();

            Console.Read();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            // new c++ progere
            Programmer freelancer = new FreelanceProgrammer(new CPPLanguage());

            freelancer.DoWork();
            freelancer.EarnMoney();
            // new order, but needs C# language
            freelancer.Language = new CSharpLanguage();
            freelancer.DoWork();
            freelancer.EarnMoney();

            Console.Read();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            // create a new programmer who is working with c++
            Programmer freelancer = new FreelanceProgrammer(new CPPLanguage());

            freelancer.DoWork();
            freelancer.EarnMoney();
            // received a new task , but now we need c#
            freelancer.Language = new CSharpLanguage();
            freelancer.DoWork();
            freelancer.EarnMoney();

            Console.Read();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Programmer freelancer = new FreelanceProgrammer(new CPPLanguage());

            Console.WriteLine("---------------Programing in C++ ---------------");
            Console.WriteLine();
            freelancer.DoWork();
            freelancer.EarnMoney();
            Console.WriteLine();
            freelancer.Language = new CSharpLanguage();
            Console.WriteLine("---------------Programing in C# ---------------");
            Console.WriteLine();
            freelancer.DoWork();
            freelancer.EarnMoney();

            Console.ReadLine();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.Title           = "Bridge";

            // создаем нового программиста, он работает с с++
            Programmer freelancer = new FreelanceProgrammer(new CPPLanguage());

            freelancer.DoWork();
            freelancer.EarnMoney();
            // пришел новый заказ, но теперь нужен c#
            freelancer.Language = new CSharpLanguage();
            freelancer.DoWork();
            freelancer.EarnMoney();

            Console.ReadKey();
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            ILanguage language = new CSharpLanguage();

            var freelance = new FreelanceProgrammer(language);

            freelance.DoWork();
            freelance.EarnMoney();

            Console.WriteLine();

            var corporate = new CorporateProgrammer(language);

            corporate.DoWork();
            corporate.EarnMoney();
        }