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

            frontEnd.Salutation();
            frontEnd.Compute();
        }
예제 #2
0
파일: Calc.cs 프로젝트: mancinoa/GitHubDemo
        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}");
            }
        }