Ejemplo n.º 1
0
        public Icalculations GetIcalculations(int number)
        {
            Icalculations obj = null;

            if (number == 1)
            {
                //the implementation of the super class is done in the child class
                //superclass object= new subclass
                obj = new Add();
            }
            else if (number == 2)
            {
                //the implementation of the super class is done in the child class
                //superclass object= new subclass
                obj = new Sub();
            }
            else if (number == 3)
            {
                //the implementation of the super class is done in the child class
                //superclass object= new subclass
                obj = new multiply();
            }
            else if (number == 4)
            {
                //the implementation of the super class is done in the child class
                //superclass object= new subclass
                obj = new Harder();
            }

            return(obj);
        }
    public static void Main(string [] args)
    {
        multiply obj = new multiply();

        obj.sum();
        obj.mult();
    }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            multiply <int> result = Multiply;

            Console.WriteLine(result(400, 600));

            multiply <string> value = Concat;

            Console.WriteLine(value("This is ", "Result!!"));
            Console.ReadLine();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            multiply multiDelegate = new multiply(multiplyNumbers);
            multiDelegate += new multiply(multiplyNumbers);
            var multiplicationResult = multiDelegate(3, 2);
            Console.WriteLine(multiplicationResult);

            multiDelegate += new multiply(devideNumbers);
            var devisionResult = multiDelegate(10, 2);
            Console.WriteLine(devisionResult);
            Console.Read();
        }
Ejemplo n.º 5
0
 // Update is called once per frame
 void Update()
 {
     Multiply = Manager.questionArray [Manager.questionNumber].GetComponent <multiply> ();
 }