Пример #1
0
        static void Main(string[] args)
        {
            EmployeeModel viewModel = new EmployeeModel();
            string        val       = "y";

            Console.WriteLine("Welcome to monthly tax calaulator.");
            while (val == "y")
            {
                Console.WriteLine("Please enter your name");
                string username = Console.ReadLine();

                Console.WriteLine("Please enter the annual salary");
                decimal salary;
                String  input = Console.ReadLine();

                while (!decimal.TryParse(input, out salary))
                {
                    Console.WriteLine("Not a valid number, try again.");
                    input = Console.ReadLine();
                }

                viewModel.DisplayIncomeInformation(username, salary);
                Console.Write("Would you like to try this one more time? Press 'y' and enter to continue or anything else to exit.");
                val = Console.ReadLine();
            }
        }