Ejemplo n.º 1
0
        /// <summary>
        /// This method is the entry point of the application
        /// </summary>
        /// <param name="args"></param>
        static private void Main(string[] args)
        {
            mathLib = new MathLib();

            do
            {
                mathRequest = AskForUserInput();
                mathLib.ExecuteRequest(mathRequest);
                Console.WriteLine("Your request                : " + mathRequest.ToString() + "\r\n");

                AskUserToContinue();
            }while (true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method asks the user to input both operandes and operator
        /// </summary>
        static private MathRequest AskForUserInput()
        {
            Console.Write("**********************\r\n");

            MathRequest mathRequest = null;

            Console.Write("Enter first operand         : ");
            int op1 = int.Parse(Console.ReadLine());

            Console.Write("Enter operator (+, -, *, /) : ");
            char ope = char.Parse(Console.ReadLine());

            Console.Write("Enter second operand        : ");
            int op2 = int.Parse(Console.ReadLine());

            return(mathRequest = new MathRequest(op1, ope, op2));
        }
Ejemplo n.º 3
0
 public void DoStuff()
 {
     var someRequest  = new MathRequest();
     var someResponse = _processors[someRequest.GetType()].Process(someRequest);
 }