Example #1
0
    public static void Main()
    {
        ICalculator sciCalc       = new ScientificCalculator();
        double      sciCalcResult = sciCalc.Add(2, 5);

        Console.WriteLine($"Scientific Calculator 2 + 5: {sciCalcResult}");

        ICalculator prgCalc       = new ProgrammerCalculator();
        double      prgCalcResult = prgCalc.Add(5, 10);

        Console.WriteLine($"Programmer Calculator 5 + 10: {prgCalcResult}");

        Console.ReadKey();
    }
Example #2
0
    public static void Main()
    {
        ScientificCalculator sciCalc = new ScientificCalculator();
        double powerResult = sciCalc.Power(2, 5);
        Console.WriteLine($"Scientific Calculator 2**5: {powerResult}");
        double sciSum = sciCalc.Add(3, 3);
        Console.WriteLine($"Scientific Calculator 3 + 3: {sciSum}");
        ProgrammerCalculator prgCalc = new ProgrammerCalculator();
        double orResult = prgCalc.Or(5, 10);
        Console.WriteLine($"Programmer Calculator 5 | 10: {orResult}");

        double prgSum = prgCalc.Add(3, 3);
        Console.WriteLine($"Programmer Calculator 3 + 3: {prgSum}");
        Console.ReadKey();
    }
Example #3
0
    public static void Main()
    {
        ScientificCalculator sciCalc = new ScientificCalculator();
        double powerResult           = sciCalc.Power(2, 5);

        Console.WriteLine($"Scientific Calculator 2**5: {powerResult}");
        double sciSum = sciCalc.Add(3, 3);

        Console.WriteLine($"Scientific Calculator 3 + 3: {sciSum}");
        ProgrammerCalculator prgCalc = new ProgrammerCalculator();
        double orResult = prgCalc.Or(5, 10);

        Console.WriteLine($"Programmer Calculator 5 | 10: {orResult}");

        double prgSum = prgCalc.Add(3, 3);

        Console.WriteLine($"Programmer Calculator 3 + 3: {prgSum}");
        Console.ReadKey();
    }