private static CalculatorType AskForCalculationMode()
 {
     Console.WriteLine("Which calculator mode do you want?");
     Console.WriteLine(" {0}) Numbers", (int)CalculatorType.Number);
     Console.WriteLine(" {0}) Dates", (int)CalculatorType.Date);
     return((CalculatorType)Prompts.AskForNumber("> "));
 }
Esempio n. 2
0
        public void PerformOneCalculation()
        {
            var date   = Prompts.AskForDate("Please enter a date: ");
            var number = Prompts.AskForNumber("Please enter the number of days to add: ");
            var answer = date.AddDays(number);

            logger.LogCalculation($"{date:dd/MM/yyyy} + {number}", answer.ToString("dd/MM/yyyy"));
            Console.WriteLine("The answer is: {0:dd/MM/yyyy}", answer);
            Console.WriteLine();
        }