Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("---------Basic Static--------");
            int[] numbers = { 1, 3, 6, 7, 9, 13, 4 };
            BasicStatistic.FindMax(numbers);
            BasicStatistic.FindMin(numbers);
            BasicStatistic.CalculateAverage(numbers);

            //--------------Flat Array---------------//
            Console.WriteLine("\n");
            Console.WriteLine("--------Flat Array--------");
            FlatArray.Combine();

            //-------------Triangle of Numbers-----------//
            Console.WriteLine("\n");
            Console.WriteLine("------------Triangle of Numbers-----------");
            TriangleOfNumbers.Run(5);

            //-------------Triangle of Stars-----------//
            Console.WriteLine("\n");
            Console.WriteLine("------------Triangle Stars-----------");
            TriangleStars.Run(7);

            //-------------Multiplication Array-----------//
            int[] firstArray  = { 1, 3, -5, 4 };
            int[] secondArray = { 1, 4, -5, -2 };
            Console.WriteLine("\n");
            Console.WriteLine("------------Multiplication Array-----------");
            MultiplicationOfTwoArray.MultiplyArray(firstArray, secondArray);

            //-------------Count Duplicate-----------//
            int[] duplicate = { 1, 3, 5, 1, 4, 5, 2, 4, 3, 5, 3, 1 };
            Console.WriteLine("\n");
            Console.WriteLine("------------Count Duplicate-----------");
            HowManyDuplicates.Run(duplicate);

            //-------------Separator------------//
            Console.WriteLine("\n");
            string kata     = "minum susu sapi";
            char   karakter = '*';

            Console.WriteLine("------------Separator-----------");
            Separator.Run(kata, karakter);

            //-------------To Uppercase-----------//
            Console.WriteLine("\n");
            Console.WriteLine("------------To Uppercase-----------");
            VowelToUppercase.Run("qwertyuiop");


            //-------------Generate Calender-----------//
            Console.WriteLine("\n");
            Console.WriteLine("------------Generate Calendar-----------");
            Console.WriteLine("\n");
            GenerateCalendar.Run(2020, 3);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            int[] numbers = { 5, 2, 5, 77, 100, 31, 3, -13, 4, 0, -19 };
            BasicStatistic.FindMax(numbers);
            BasicStatistic.FindMin(numbers);
            BasicStatistic.CalculateAverage(numbers);
            BasicStatistic.CalculateTotal(numbers);

            FlatArray.Combine();
            HowManyDuplicates.Run();
            MultiplicationOfTwoArray.Run();
            Separator.Run();
            TriangleOfNumbers.Run();
            TriangleStars.Run();
            VowelToUppercase.Run();
            GenerateCalendar.Run();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            int[] numbers        = { 5, 2, 5, 77, 100, 31, 3, -13, 4, 0, -19 };
            int[] theFirstArray  = { 2, 52, 56, 12, 3 };
            int[] theSecondArray = { 1, 0, 65, 42 };
            int[] theThirdArray  = { 3, 4, 6 };
            int[] dups           = { 1, 3, 5, 1, 4, 5, 2, 4, 3, 5, 3, 1 };
            int[] multiply1      = { 1, 3, -5, 4 };
            int[] multiply2      = { 1, 4, -5, -2 };


            // ====================BASIC STATISTIC======================================//
            BasicStatistic.FindMax(numbers);
            BasicStatistic.FindMin(numbers);
            BasicStatistic.CalculateAverage(numbers);
            BasicStatistic.CalculateTotal(numbers);
            //=====================FLAT ARRAY==========================================//
            FlatArray.Combine(theFirstArray, theSecondArray, theThirdArray);
            //=====================MULTIPICATION=======================================//
            MultiplicationOfTwoArray.Multiplication(multiply1, multiply2);
            //=====================SEPARATOR===========================================//
            Separator.separators("Huda Fauzan Murtadho", "*");
            //=====================DUPLICATE===========================================//
            HowManyDuplicates.Run(dups);
            //=====================TRIANGELNUMBER======================================//
            TriangleOfNumbers.Run();
            //=====================TRIANGELSTARTS======================================//
            TriangleStars.Run();
            //=============================VOWEL=======================================//
            VowelToUppercase.Run("aaaa jku suka iko enak");
            //====================================CALENDAR=============================//
            Console.WriteLine(GenerateCalendar.Calendar("Januari 2019"));



            // Separator.Run();
            //HowManyDuplicates.Run();
        }
        static void Main(string[] args)
        {
            int[] numbers = { 5, 2, 5, 77, 100, 31, 3, -13, 4, 0, -19 };
            BasicStatistic.FindMax(numbers);
            BasicStatistic.FindMin(numbers);
            BasicStatistic.CalculateAverage(numbers);

            int[] theFirstArray  = { 2, 52, 56, 12, 3 };
            int[] theSecondArray = { 1, 0, 65, 42 };
            int[] theThirdArray  = { 3, 4, 6 };
            FlatArray.Combine(theFirstArray, theSecondArray, theThirdArray);

            HowManyDuplicates.Run();
            MultiplicationOfTwoArray.Run();
            string str = "minum susu sapi";

            Separator.Run(str, "-");
            Separator.Run(str, "*");
            TriangleOfNumbers.Run();
            TriangleStars.Run();
            VowelToUppercase.Run("rasanya otakku semakin keram");
            GenerateCalendar.Run(2020, 1);
        }
Exemple #5
0
        static void Main(string[] args)
        {
            int[] numbers = { 5, 2, 5, 77, 100, 31, 3, -13, 4, 0, -19 };
            Console.WriteLine("max value : {0}", BasicStatistic.FindMax(numbers));
            Console.WriteLine("min value : {0}", BasicStatistic.FindMin(numbers));
            Console.WriteLine("avg value : {0}", BasicStatistic.CalculateAverage(numbers));
            Console.WriteLine("sum value : {0}", BasicStatistic.CalculateTotal(numbers));
            Console.WriteLine("==========================================================");

            Console.WriteLine("Combine Array");
            int[] arr1 = { 2, 52, 56, 12, 3 };
            int[] arr2 = { 1, 0, 65, 42 };
            int[] arr3 = { 3, 4, 6 };
            int[] arr  = FlatArray.Combine(arr1, arr2, arr3);
            foreach (var x in arr)
            {
                Console.Write($"{x}   ");
            }

            Console.WriteLine();
            Console.WriteLine("==========================================================");

            Console.WriteLine("generate calendar");

            Console.WriteLine("==========================================================");

            Console.WriteLine("how many duplicate");
            int[] dups = { 1, 3, 5, 1, 4, 5, 2, 4, 3, 5, 3, 1 };
            var   dup  = HowManyDuplicates.Run(dups);

            foreach (var x in dup)
            {
                Console.WriteLine("{0} ==> {1}x", x.Key, x.Value);
            }

            Console.WriteLine("==========================================================");

            Console.WriteLine("array multiplication");

            int[] arr4 = { 1, 3, -5, 4 };
            int[] arr5 = { 1, 4, -5, -2 };
            int[] res  = MultiplicationOfTwoArray.arrMultiply(arr4, arr5);

            foreach (var x in res)
            {
                Console.Write($"{x} ");
            }
            Console.WriteLine();
            Console.WriteLine("==========================================================");

            Console.WriteLine("Separator");
            Console.WriteLine(Separator.Run("okeoekokv okokasd"));
            Console.WriteLine(Separator.Run("okeoekokv okokasd", "%"));
            Console.WriteLine("==========================================================");

            Console.WriteLine("triangle of number");
            Console.WriteLine(TriangleOfNumbers.Run(4));
            Console.WriteLine("==========================================================");

            Console.WriteLine("triangle of star");
            Console.WriteLine(TriangleStars.Run(4));
            Console.WriteLine("==========================================================");

            Console.WriteLine("vowel to upper");
            Console.WriteLine(VowelToUppercase.upperVowel("okeoke jos cendol dawet"));
            Console.WriteLine("==========================================================");

            Console.WriteLine("Generate Calendar");

            Console.WriteLine(GenerateCalendar.createTable("Februari 2020"));
            // GenerateCalendar.createTable("January 2019");
        }