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 Retirement
- {
- class Program
- {
- static void Main(string[] args)
- {
- string Gender = Console.ReadLine().ToLower();
- int Age = int.Parse(Console.ReadLine());
- int WorkingExperience = int.Parse(Console.ReadLine());
- if (Gender != "male" && Gender != "female" || Age <= 1 || Age >= 10000 || WorkingExperience <= 1 || WorkingExperience >= 10000)
- {
- Console.WriteLine("Invalid input.");
- }
- else
- {
- bool CheckAllGood = Age >= 64 && WorkingExperience >= 38;
- bool CheckAge = Age < 64 && WorkingExperience >= 38;
- bool CheckWorkingExperience = Age >= 64 && WorkingExperience < 38;
- bool CheckAgeAndExperience = Age < 64 && WorkingExperience < 38;
- if (Gender == "male")
- {
- if (CheckAllGood)
- {
- Console.WriteLine($"Ready to retire at {Age} and {WorkingExperience} years of experience!");
- }
- else if (CheckAge)
- {
- Console.WriteLine($"Worked enough, but not old enough. Years left to retirement: {64 - Age}.");
- }
- else if (CheckWorkingExperience)
- {
- Console.WriteLine($"Old enough, but haven't worked enough. Work experience left to retirement: {38 - WorkingExperience}.");
- }
- else if (CheckAgeAndExperience)
- {
- Console.WriteLine($"Too early. Years left to retirement: {64 - Age}. Working experience left to retirement: {38 - WorkingExperience}.");
- }
- }
- bool CheckAllGoodFemale = Age >= 61 && WorkingExperience >= 35;
- bool CheckAgeFemale = Age < 61 && WorkingExperience >= 35;
- bool CheckWorkingExperienceFemale = Age >= 61 && WorkingExperience < 35;
- bool CheckAgeAndExperienceFemale = Age < 61 && WorkingExperience < 35;
- if (Gender == "female")
- {
- if (CheckAllGoodFemale)
- {
- Console.WriteLine($"Ready to retire at {Age} and {WorkingExperience} years of experience!");
- }
- else if (CheckAgeFemale)
- {
- Console.WriteLine($"Worked enough, but not old enough. Years left to retirement: {61 - Age}.");
- }
- else if (CheckWorkingExperienceFemale)
- {
- Console.WriteLine($"Old enough, but haven't worked enough. Work experience left to retirement: {35 - WorkingExperience}.");
- }
- else if (CheckAgeAndExperienceFemale)
- {
- Console.WriteLine($"Too early. Years left to retirement: {64 - Age}. Working experience left to retirement: {38 - WorkingExperience}.");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment