コード例 #1
0
ファイル: Program.cs プロジェクト: Kanta62/Lab-final
        static void Main(string[] args)
        {
            BasicCalculator basicCalculator = new BasicCalculator();

            Console.WriteLine(basicCalculator.sum(10, 5));
            Console.WriteLine(basicCalculator.sub(10, 5));
            Console.WriteLine(basicCalculator.multiplication(10, 5));
            Console.WriteLine(basicCalculator.division(10, 5));

            ScientificCalculator scientificCalculator = new ScientificCalculator();

            Console.WriteLine(scientificCalculator.root(121));
            Console.WriteLine(scientificCalculator.square(11));
            Console.WriteLine(scientificCalculator.sub(15, 5));
            Console.WriteLine(scientificCalculator.multiplication(15, 5));
            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("*************************");
            Console.WriteLine("Basic Calculator");
            Console.WriteLine("*************************");

            BasicCalculator bc = new BasicCalculator();

            Console.WriteLine("Sum : " + bc.Sum(12, 13));
            Console.WriteLine("Sub : " + bc.Sub(12, 13));
            Console.WriteLine("Multiplication : " + bc.Multiplication(2, 3));
            Console.WriteLine("Division : " + bc.Division(12, 6));
            ScientificCalculator sc = new ScientificCalculator();

            Console.WriteLine("*************************");
            Console.WriteLine("Scientific Calculator");
            Console.WriteLine("*************************");
            Console.WriteLine("Logarithm : " + sc.Logarithm(1));
            Console.WriteLine("Root : " + sc.Root(64));
            Console.WriteLine("Power : " + sc.XtoY(3, 3));
        }