Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            int[] r = new int[10] {
                10, 11, 12, 13, 14, 15, 16, 17, 18, 19
            };
            var x = Enumerable.Range(1, 10).ToArray();

            int[] y = new int[4] {
                10, 20, 30, 40
            };
            Eng35Tests.CreateArrayFromSentence("Sam is Amazing");
            Eng35Tests.CreateArrayFromSentence2("Sam is the best");
            Eng35Tests.Calculate_Words_In_Sentence("Sam is Amazing");
            Eng35Tests.Turn_First_Word_To_Uppercase("Sam is Amazing");
            Eng35Tests.Mega_Multiple_Coding_Loop(r);
            Eng35Tests.SumOfArray(x);
            Eng35Tests.How_Many_Numbers_Divisible_By(2, 10, 4);
            Eng35Tests.Array_Loop_Queue_Stack(y);


            /*Write a short program that prints each number from 1 to 100 on a new line.
             *
             * For each multiple of 3, print "Fizz" instead of the number.
             *
             * For each multiple of 5, print "Buzz" instead of the number.
             *
             *
             * For numbers which are multiples of both 3 and 5, print "FizzBuzz" instead of the number*/

            for (int i = 1; i <= 100; i++)
            {
                if (i % 3 == 0 && i % 5 == 0)
                {
                    Console.WriteLine("FizzBuzz");
                }
                else if (i % 3 == 0)
                {
                    Console.WriteLine("Fizz");
                }
                else if (i % 5 == 0)
                {
                    Console.WriteLine("Buzz");
                }
                else
                {
                    Console.WriteLine(i);
                }
            }
        }
Ejemplo n.º 2
0
        public void TestForDivisor(int num1, int num2, int divisor, int expected)
        {
            var actual = Eng35Tests.How_Many_Numbers_Divisible_By(num1, num2, divisor);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void How_Many_Numbers_Divisible(int x, int y, int z, int expected)
        {
            var actual = Eng35Tests.How_Many_Numbers_Divisible_By(x, y, z);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void DivisibleTest(int start, int end, int divisor, int expected)
        {
            var actual = Eng35Tests.How_Many_Numbers_Divisible_By(start, end, divisor);

            Assert.AreEqual(expected, actual);
        }