Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public void SimpleInterestCalculation()
        {
            SimpleInterest fixInterestObj = new SimpleInterest(10000, 2.5, 6.75);
            SimpleInterest interestObj    = new SimpleInterest();

            Console.WriteLine("Fixed Simple Interest is:");
            double simpleInterestFixed = fixInterestObj.CalculateInterest();

            Console.WriteLine(simpleInterestFixed);

            Console.WriteLine("To Calculate Interest for your input:");
            interestObj.AcceptInterestElements();
            double simpleInterestAmount = interestObj.CalculateInterest();

            Console.WriteLine("Your Simple Interest is:");
            Console.WriteLine(Math.Round((double)simpleInterestAmount, 2));
        }