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(); }
public void CountNumberOfDistinctWords() { DistinctWords dWordObj = new DistinctWords(); CaseConversion caseObj = new CaseConversion(); string userString; string[] outputArray = caseObj.TakeInputStrings(out userString); int distinctCount = dWordObj.GetDistinctCount(outputArray); Console.WriteLine("Number of distinct words in your array \'{0}\' are: {1}", userString, distinctCount); }
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); }
public void UnitTestCases() { CaseConversion caseObj = new CaseConversion(); string userString; string[] outputArray = caseObj.TakeInputStrings(out userString); string camelString = caseObj.ConvertToCamelCase(outputArray); Console.WriteLine("String in camelCase: {0}", camelString); string titleStringDefault = caseObj.ConvertToTitleDefault(userString); Console.WriteLine("String in Title Case using in-built function: {0}", titleStringDefault); string titleString = caseObj.ConvertToTitleCase(outputArray); Console.WriteLine("String in Title Case: {0}", titleString); }