Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please Enter Integer:"); //Asking for user input
            string line = Console.ReadLine();
            int    data = Int32.Parse(line);            //converting string to int data type



            Console.WriteLine("Please enter decimal");
            string  line2 = Console.ReadLine();
            decimal data1 = Decimal.Parse(line2); //getting float data type

            Console.WriteLine("Please enter favorite number");
            string line3 = Console.ReadLine();
            float  data2 = Int32.Parse(line3);



            var operatorObject = new methods.ArthematicOperations(); //refrencing thread
            var answer         = operatorObject.Add(data);
            var answer1        = operatorObject.Add(data1);
            var answer2        = operatorObject.Add(data2);



            Console.WriteLine(line + " Multiplyed by 12 = " + answer);
            Console.WriteLine(line2 + " divided by 3 = " + answer1);
            Console.WriteLine(line3 + " added by 5 is " + answer2);
            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please Enter Integer:"); //Asking for user input
            string line = Console.ReadLine();
            int    data = Int32.Parse(line);            //converting string to int data type

            var operatorObject = new methods.ArthematicOperations();
            var answer         = operatorObject.Multiply(data);
            var answer1        = operatorObject.Add(data);
            var answer2        = operatorObject.Subtract(data);


            Console.WriteLine(line + " multiplyed by 6 = " + answer);
            Console.WriteLine(line + " Added to 10 = " + answer1);
            Console.WriteLine(line + " Subtracted by 5 = " + answer2);

            Console.ReadLine();
        }