コード例 #1
0
        public string Transform(string word)
        {
            var reverser = new Reverser();

            Word = reverser.Transform(word);
            Word = Word.ToUpper();
            return(Word);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: EMerchant90/CSharpExamples
        static void Main(string[] args)
        {
            var      word       = "Ejaz is the best baby!";
            Reverser reverser   = new Reverser();
            var      moveObject = (ITransformer)reverser;

            Console.WriteLine(moveObject.Transform(word));
            Console.WriteLine(reverser.Transform(word));


            //var upperReverse = new UpperCaseReverser();

            Console.WriteLine($"{reverser.Transform(word)}");
            //Console.WriteLine($"{upperReverse.Transform(word)}");

            //Program.Main(new string[] { "Hello String" });

            //var word = "Ejaz is the best baby!";
            //Console.WriteLine(StringUtilities.Reverse(word));
            //Console.WriteLine(StringUtilities.Reverse(word));
            //Console.WriteLine(StringUtilities.Reverse(word));
            //Console.WriteLine(StringUtilities.Reverse(word));
            //Console.WriteLine(StringUtilities.Reverse(word));
            //Console.WriteLine(StringUtilities.Reverse(word));
            //Console.WriteLine(StringUtilities.Reverse(word));

            //Console.WriteLine($"The reverse method was called {StringUtilities.ReverseCount} times");
            //var upperReverser = new UpperCaseReverser(word);
            //Console.WriteLine($"upper reverser transform: {wordTransform.Transform(word)}");
            //Console.WriteLine($"upper reverser transform: {upperReverser.Transform()}");

            //var calc = new Calculator();
            //calc.Add(10,20);

            //var numbers = new int[] { 1, 2, 3 };
            //calc.Add(numbers);

            //var savings = new InterestAccount();
            //savings.accountType = "savings";
            //savings.isActive = true;
            //savings.amount = 9000.7M;
            //Console.WriteLine(savings.amount);

            //var rex = new TRex();
            //rex.Name = "Luchasaurus";
            //rex.Roar();

            //var bigBoat = new Boat();
            //bigBoat.Name = "Titanic";
            //bigBoat.Tonnage = 46_000;

            //Boat? mysteriousBoat = bigBoat;
            //Boat mysteriousBoatValue = mysteriousBoat.Value;
            //mysteriousBoatValue.Name = "Mary Celeste";
            //mysteriousBoatValue.Tonnage = 247;

            //Console.WriteLine($"{bigBoat.Name} - {bigBoat.Tonnage} tons");
            //Console.WriteLine($"{mysteriousBoatValue.Name} - {mysteriousBoatValue.Tonnage} tons");

            //mysteriousBoat = null;

            //Console.WriteLine($"{bigBoat.Name} - {bigBoat.Tonnage} tons");
            //Console.WriteLine($"{mysteriousBoatValue.Name} - {mysteriousBoatValue.Tonnage} tons");

            //var clicker = new NPC("Clicker");
            //Console.WriteLine($"This new enemy named {clicker.Name} is dangerous, luckily it's only currently at {clicker.Health}");

            //var toyo = new Car();
            //Console.WriteLine($"The speed is {toyo.Speed}");
            //toyo.Speed = 45.09;
            //Console.WriteLine($"The speed is {toyo.Speed}");


            //var monster = new Monster();
            //monster.Name = "Cookie Monster";
            //monster.Damage = 10;

            //Console.WriteLine($"{monster.Name} does {monster.Damage} damage");
            //monster.DoubleDamage = true;
            //Console.WriteLine($"{monster.Name} does {monster.Damage} damage");


            //var service = new WebService();
            //var data = service.GetStudentProfile(100);

            //Console.WriteLine(data.student.firstName + " " + data.Item1.lastName);
            //Console.WriteLine(data.grades[0]);
            //var UXforVR = new BookReview();

            //UXforVR.SetName("UXforVR");
            //UXforVR.SetScore(7);

            //Console.WriteLine(UXforVR.GetName());
            //Console.WriteLine(UXforVR.GetScore());
        }