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 programka
- {
- class Program
- {
- static void Main(string[] args)
- {
- double salary = double.Parse(Console.ReadLine());
- int timeWorked = int.Parse(Console.ReadLine());
- string member = Console.ReadLine();
- double currentSalary = 0;
- int years = 0;
- for (int i = 1; i <= 1000; i++)
- {
- salary = salary + (salary * 0.06);
- if (member == "Yes" && i % 10 != 5 && i % 10 != 0)
- {
- salary = salary - (salary * 0.01);
- }
- if (i % 10 == 5)
- {
- salary += 100;
- }
- if (i % 10 == 0)
- {
- salary += 200;
- }
- currentSalary = salary;
- if (i == timeWorked && currentSalary < 5000)
- {
- Console.WriteLine($"Current salary: {currentSalary:f2}");
- }
- else if (currentSalary >= 5000 && timeWorked >= i)
- {
- Console.WriteLine($"Current salary: {5000:f2}");
- Console.WriteLine($"{0} more years to max salary.");
- break;
- }
- if (currentSalary >= 5000)
- {
- years = i - 1 - timeWorked;
- Console.WriteLine($"{years} more years to max salary.");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment