Example #1
0
        public void Run()
        {
            writer.WriteLine(GlobalMessages.welcomeMessage);
            var input = string.Empty;

            while (input != "stop")
            {
                writer.Write(GlobalMessages.enterSalaryMsg);
                input = reader.ReadLine();

                try
                {
                    input.IsValidInput();
                    var result = salaryService.CalculateNetSalary(decimal.Parse(input));
                    writer.WriteLine(string.Format(GlobalMessages.netSalaryResult, result));
                }
                catch (Exception ex)
                {
                    writer.WriteLineRedColor(ex.Message);
                }
            }
        }