예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Assignment 1: Camel case and title case");
            CaseConversion caseObj = new CaseConversion();

            caseObj.UnitTestCases();

            Console.WriteLine("Assignment 2: No. of words in string");
            StringWords wordObj = new StringWords();

            wordObj.CountNumberOfWords();

            Console.WriteLine("Assignment 3: No. of distinct words in string");
            DistinctWords dWordObj = new DistinctWords();

            dWordObj.CountNumberOfDistinctWords();

            Console.WriteLine("Assignment 4: 2nd max no.");
            MaxNum maxObj = new MaxNum();

            maxObj.FindSecondMax();

            Console.WriteLine("Assignment 5: Using Delegate");
            UsingDelegate delObj = new UsingDelegate();

            delObj.DelegateUse();

            Console.WriteLine("Assignment 6: Simple interest calculation");
            SimpleInterest interestObj = new SimpleInterest();

            interestObj.SimpleInterestCalculation();
        }
예제 #2
0
        public void CountNumberOfWords()
        {
            StringWords    wordObj = new StringWords();
            CaseConversion caseObj = new CaseConversion();

            string userString;

            string[] outputArray   = caseObj.TakeInputStrings(out userString);
            int      numberOfWords = wordObj.GetCount(outputArray);

            Console.WriteLine("Number of words in your string \'{0}\' are: {1}", userString, numberOfWords);
        }