Exemple #1
0
        }//Percentage

        public static void SquareRoot(string inputA)
        {
            double numA;

            Console.WriteLine("Square Root Calculator");
            numA = MyCalculator.InputA(inputA);
            Console.WriteLine($"Result: Square Root of {numA} = {System.Math.Sqrt(numA)}");
            return;
        }//SquareRoot
Exemple #2
0
        }//SquareRoot

        public static void AreaTriangle(string op, string inputA, string inputB)
        {
            double numA;
            double numB;

            Console.WriteLine("Triangle Area Calculator");
            numA = MyCalculator.InputA(inputA);
            numB = MyCalculator.InputB(op, numA, inputB);
            Console.WriteLine($"Result: {numA} {op} {numB} / 2 = {((numB * numB) / 2)}");
            return;
        }//AreaTriangle
Exemple #3
0
        }//Multiplication

        public static void Percentage(string op, string inputA, string inputB)
        {
            double numA;
            double numB;

            Console.WriteLine("Percentage Calculator");
            numA = MyCalculator.InputA(inputA);
            numB = MyCalculator.InputB(op, numA, inputB);
            Console.WriteLine($"Result: {numA} {op} {numB} * 100 = {(numA / numB) * 100}%");
            return;
        }//Percentage
Exemple #4
0
        }//Division

        public static void Multiplication(string op, string inputA, string inputB)
        {
            double numA;
            double numB;

            Console.WriteLine("Multiplication Calculator");
            numA = MyCalculator.InputA(inputA);
            numB = MyCalculator.InputB(op, numA, inputB);
            Console.WriteLine($"Result: {numA} {op} {numB} = {numA * numB}");
            return;
        }//Multiplication
Exemple #5
0
        }//AreaTriangle

        public static void Volume(string op, string inputA, string inputB, string inputC)
        {
            double numA;
            double numB;
            double numC;

            Console.WriteLine("Volume Calculator");
            numA = MyCalculator.InputA(inputA);
            numB = MyCalculator.InputB(op, numA, inputB);
            numC = MyCalculator.InputC(op, numA, numB, inputC);
            Console.WriteLine($"Result: {numA} {op} {numB} {op} {numC} = {(numA * numB) * numC}");
            return;
        } //Volume