示例#1
0
        static void Main(string[] args)
        {
            Program1 frontEnd = new Program1();
            Calc     calc     = new Calc();

            frontEnd.Salutation();
            frontEnd.Compute();
        }
示例#2
0
        public void Divide(double num1, double num2, string oper)
        {
            Program1 frontEnd = new Program1();

            if (num2 == 0)
            {
                Console.WriteLine("Division by 0 is not valid. Press enter to retry");
                Console.ReadLine();
                frontEnd.Compute();
            }
            else
            {
                double result = num1 / num2;
                Console.WriteLine($"\nThe result is: {num1} {oper} {num2} = {result}");
            }
        }