Example #1
0
        static void Main(string[] args)
        {
            MathProxy _mathProxy = new MathProxy();

            Console.WriteLine("2 + 2 = {0}", _mathProxy.Add(2, 2));
            Console.WriteLine("2 - 2 = {0}", _mathProxy.Subtract(2, 2));
            Console.WriteLine("2 * 2 = {0}", _mathProxy.Multiply(2, 2));
            Console.WriteLine("2 / 2 = {0}", _mathProxy.Divide(2, 2));
            Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            MathProxy proxy = new MathProxy();

            Console.WriteLine("4 + 2 = {0}", proxy.Add(4, 2));
            Console.WriteLine("4 - 2 = {0}", proxy.Sub(4, 2));
            Console.WriteLine("4 * 2 = {0}", proxy.Mul(4, 2));
            Console.WriteLine("4 / 2 = {0}", proxy.Div(4, 2));
            Console.ReadKey();
        }
Example #3
0
        static void Main()
        {
            MathProxy proxy = new MathProxy();


            Console.WriteLine("10 + 2 = " + proxy.Add(4, 2));
            Console.WriteLine("10 - 2 = " + proxy.Sub(4, 2));
            Console.WriteLine("10 * 2 = " + proxy.Mul(4, 2));
            Console.WriteLine("10 / 2 = " + proxy.Div(4, 2));

            Console.ReadKey();
        }
Example #4
0
        static void Main(string[] args)
        {
            // Create math proxy
            MathProxy proxy = new MathProxy();

            // Do the math
            Console.WriteLine("4 + 2 = " + proxy.Add(4, 2));
            Console.WriteLine("4 - 2 = " + proxy.Sub(4, 2));
            Console.WriteLine("4 * 2 = " + proxy.Mul(4, 2));
            Console.WriteLine("4 / 2 = " + proxy.Div(4, 2));
            // Wait for user
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            //proxy
            Proxy proxy = new Proxy();

            proxy.Request();

            //Example as below
            MathProxy mathProxy = new MathProxy();

            Console.WriteLine("4 + 2 = " + mathProxy.Add(4, 2));
            Console.WriteLine("4 - 2 = " + mathProxy.Sub(4, 2));
            Console.WriteLine("4 * 2 = " + mathProxy.Mul(4, 2));
            Console.WriteLine("4 / 2 = " + mathProxy.Div(4, 2));
            Console.ReadKey();
        }
Example #6
0
        static void Main(string[] args)
        {
            MathProxy proxy = new MathProxy();

            Console.WriteLine($"4 + 2 = {proxy.Add(4, 2)}");
            Console.WriteLine($"4 - 2 = {proxy.Sub(4, 2)}");
            Console.WriteLine($"4 * 2 = {proxy.Multiply(4, 2)}");
            Console.WriteLine($"4 / 2 = {proxy.Divide(4, 2)}");

            try
            {
                Console.WriteLine($"4 / 0 = {proxy.Divide(4, 0)}");
            }
            catch (DivideByZeroException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Example #7
0
        static void Main(string[] args)
        {
            MathProxy proxy = new MathProxy();

            double addresult = proxy.Add(2, 3);
            Console.WriteLine(addresult);

            double subresult = proxy.Sub(2, 3);
            Console.WriteLine(subresult);

            double mulresult = proxy.Mul(2, 3);
            Console.WriteLine(mulresult);

            double devresult = proxy.Dev(2, 3);
            Console.WriteLine(devresult);

            Console.Read();
        }
Example #8
0
        static void Main(string[] args)
        {
            // Create proxy and request a service
            Proxy proxy = new Proxy();

            proxy.Request();

            //x
            // Create math proxy
            MathProxy proxy2 = new MathProxy();

            // Do the math
            Console.WriteLine("4 + 2 = " + proxy2.Add(4, 2));
            Console.WriteLine("4 - 2 = " + proxy2.Sub(4, 2));
            Console.WriteLine("4 * 2 = " + proxy2.Mul(4, 2));
            Console.WriteLine("4 / 2 = " + proxy2.Div(4, 2));

            Console.ReadKey();
        }
Example #9
0
        static void Main(string[] args)
        {
            MathProxy proxy = new MathProxy();

            decimal x = 5;
            decimal y = 2;
            Console.WriteLine(proxy.Add(5, 2));

            Console.ReadKey();
        }