Exemple #1
0
        static void Main(string[] args)
        {
            SimpleCalc  sc = new SimpleCalc();
            FormulaCalc fc = new FormulaCalc();

            Console.WriteLine("Press 1 to do simple calculations or 2 to enter a formula");
            int input = Convert.ToInt32(Console.ReadLine());

            switch (input)
            {
            case 1:
                Console.Clear();
                sc.SimpleCalculator();
                break;

            case 2:
                Console.Clear();
                fc.AdvancedCalculator();
                break;

            default:
                Console.WriteLine("Not a valid option");
                break;
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SimpleCalc sc = new SimpleCalc();
            FormulaCalc fc = new FormulaCalc();

            Console.WriteLine("Press 1 to do simple calculations or 2 to enter a formula");
            int input = Convert.ToInt32(Console.ReadLine());

            switch (input)
            {
                case 1:
                    Console.Clear();
                    sc.SimpleCalculator();
                    break;
                case 2:
                    Console.Clear();
                    fc.AdvancedCalculator();
                    break;
                default:
                    Console.WriteLine("Not a valid option");
                    break;
            }
        }