static void Main(string[] args)
        {
            MyMath result1 = new MyMath();

            result1.Multiply(2, 3);
            Console.WriteLine("The result is: " + result1.getResult());

            result1.Divide(2, 3);
            Console.WriteLine("The result is: " + result1.getResult());

            result1.Add(2, 3);
            Console.WriteLine("The result is: " + result1.getResult());

            result1.Subtract(2, 3);
            Console.WriteLine("The result is: " + result1.getResult());
        }
Exemple #2
0
        static void Main(string[] args)
        {
            MyMath myResult1 = new MyMath();

            myResult1.Multiply(2, 5);
            Console.WriteLine(myResult1.GetResult());

            myResult1.Divide(10, 5);
            Console.WriteLine(myResult1.GetResult());

            myResult1.Subtract(7, 6);
            Console.WriteLine(myResult1.GetResult());

            myResult1.Add(8, 4);
            Console.WriteLine(myResult1.GetResult());
        }
Exemple #3
0
        static void Main(string[] args)
        {
            int product = MyMath.Multiply(2, 2);
            { Console.WriteLine(product); }

            int quotient = MyMath.Divide(10, 2);
            { Console.WriteLine(quotient); }

            MyMath mathobj1 = new MyMath();
            int    sum      = mathobj1.Add(1, 2);
            { Console.WriteLine(sum); }

            MyMath mathobj2   = new MyMath();
            int    difference = mathobj2.subtract(1, 2);
            { Console.WriteLine(difference); }
        }
Exemple #4
0
        static void Main(string[] args)
        {
            MyMath iMyMath = new MyMath();



            iMyMath.Multiply(10, 20);
            Console.WriteLine("The result for multiplication is: " + iMyMath.GetResult());

            iMyMath.Divide(30, 20);
            Console.WriteLine("The result of division is:" + iMyMath.GetResult());

            iMyMath.Subtract(20, 10);
            Console.WriteLine("The result of subtraction is:" + iMyMath.GetResult());

            iMyMath.Add(100, 200);
            Console.WriteLine("The result of addition is:" + iMyMath.GetResult());
        }
Exemple #5
0
        static void Main(string[] args)
        {
            //This doesn't meet all the requirements of the assignment, but it's as close as I can get right now
            //I'm not sure how to use the GetResult method in combination with the void methods in MyMath class

            MyMath MM = new MyMath();

            double operand1;
            double operand2;
            double result;



            MM.Multiply(30, 2);
            MM.Divide(35, 7);
            MM.Add(23, 2);
            MM.Subtract(17, 2);
        }
Exemple #6
0
        public void Add03()
        {
            MyMath txt = new MyMath();

            Assert.IsTrue(txt.Add(1, 1) > 1);
        }
Exemple #7
0
        public void Add02()
        {
            MyMath txt = new MyMath();

            Assert.AreEqual(txt.Add(1, 3), 4);
        }
Exemple #8
0
        public void Add01()
        {
            MyMath txt = new MyMath();

            Assert.AreEqual(txt.Add(1, 1), 2);
        }