예제 #1
0
파일: Program.cs 프로젝트: ivanmpl/projects
        static void Main(string[] args)
        {
            int option;

            Arithmetic a1 = new Arithmetic();

            a1.GetA();
            a1.GetB();
            a1.DisplayOptions();

            System.Console.Write("Enter the Arithmetic Operation number: ");
            option = Convert.ToInt32(System.Console.ReadLine());

            switch (option)
            {
            case 1:
                System.Console.WriteLine($"Result: {a1.Addition()}");
                break;

            case 2:
                System.Console.WriteLine($"Result: {a1.Subtraction()}");
                break;

            case 3:
                System.Console.WriteLine($"Result: {a1.Multiplication()}");
                break;

            case 4:
                System.Console.WriteLine($"Result: {a1.Division()}");
                break;

            default:
                Console.WriteLine($"An unexpected option selected: ({option})");
                break;
            }
        }