Esempio n. 1
0
        public IList <string> GetMultiples(string number, int multiples)
        {
            LargeNumberMultiplier lm      = new LargeNumberMultiplier();
            IList <string>        results = new List <string>();

            for (int i = 1; i <= multiples; i++)
            {
                results.Add(lm.Compute(new List <string>()
                {
                    number, i.ToString()
                }));
            }
            return(results);
        }
Esempio n. 2
0
        private static string Run(string num1, string num2, char op)
        {
            string[] numbers = new string[] { num1, num2 };
            switch (op)
            {
            case 'a':
            case '+':
                LargeNumberAdder a = new LargeNumberAdder();
                return(a.Compute(numbers));

                break;

            case 's':
            case '-':
                LargeNumberSubtractor s = new LargeNumberSubtractor();
                return(s.Compute(numbers));

                break;

            case 'x':
            case 'm':
            case '*':
                LargeNumberMultiplier m = new LargeNumberMultiplier();
                return(m.Compute(numbers));

                break;

            case '/':
            case 'd':
                LargeNumberDivider d = new LargeNumberDivider();
                return(d.Compute(numbers));

                break;

            default:
                PrintHelp();
                return("");
            }
        }