loading
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;

class MainClass {
  public static void Main (string[] args) {

    Calculator calc = new ScientificCalculator();

    ScientificCalculator sciCalc = (ScientificCalculator)calc;

    int r1 = sciCalc.mod(8, 3);

    int r2 = calc.add(5, 4);

    int r3 = calc.add(7,8,20);

    Console.WriteLine(r1);

    Console.WriteLine(r2);

    Console.WriteLine(r3);

  }
}

public class Calculator
{
  public int add(int a, int b)
  {
    return a + b;
  }

  public int add(int a, int b, int c)
  {
    return a + b + c;
  }
}

public class ScientificCalculator : Calculator
{
  public int mod(int a, int b)
  {
    return a % b;
  }
}