Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Salary
- {
- class Program
- {
- static void Main(string[] args)
- {
- var salary = decimal.Parse(Console.ReadLine());
- var workYears = int.Parse(Console.ReadLine());
- string syndicate = Console.ReadLine().ToLower();
- var neededYears = 0.0;
- for (int i = 1; ; i++)
- {
- salary *= 1.06m;
- if (i % 10 == 5)
- {
- salary += 100;
- }
- if (i % 10 == 0)
- {
- salary += 200;
- }
- if (syndicate == "yes" && i % 10 != 5 && i % 10 != 0)
- {
- salary *= 0.99m;
- }
- if (salary >= 5000)
- {
- if (i <= workYears)
- {
- Console.WriteLine($"Current salary: 5000.00");
- Console.WriteLine($"0 more years to max salary.");
- return;
- }
- else
- {
- neededYears = i - 1.0;
- break;
- }
- }
- if (i == workYears)
- {
- Console.WriteLine($"Current salary: {salary:F2}");
- }
- }
- Console.WriteLine($"{neededYears - workYears} more years to max salary.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement