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 Retirement
- {
- class Retirement
- {
- static void Main(string[] args)
- {
- string sex = Console.ReadLine();
- int age = int.Parse(Console.ReadLine());
- int internship = int.Parse(Console.ReadLine());
- if (sex == "male")
- {
- if (age >= 64)
- {
- if (internship >= 38)
- {
- Console.WriteLine($"Ready to retire at {age} and {internship} years of experience!");
- }
- else if (internship < 38 && internship >= 0)
- {
- Console.WriteLine($"Old enough, but haven't worked enough. Work experience left to retirement: {38 - internship}.");
- }
- }
- else // when age < 64
- {
- if (internship >= 38)
- {
- Console.WriteLine($"Worked enough, but not old enough. Years left to retirement: {64 - age}.");
- }
- else
- {
- Console.WriteLine($"Too early. Years left to retirement: {64 - age}. Work experience left to retirement: {38 - internship}.");
- }
- }
- }
- else if (sex == "female")
- {
- if (age >= 61)
- {
- if (internship >= 35)
- {
- Console.WriteLine($"Ready to retire at {age} and {internship} years of experience!");
- }
- else if (internship < 35 && internship >= 0)
- {
- Console.WriteLine($"Old enough, but haven't worked enough. Work experience left to retirement: {35 - internship}.");
- }
- }
- else // when age < 61
- {
- if (internship >= 35)
- {
- Console.WriteLine($"Worked enough, but not old enough. Years left to retirement: {61 - age}.");
- }
- else
- {
- Console.WriteLine($"Too early. Years left to retirement: {61 - age}. Work experience left to retirement: {35 - internship}.");
- }
- }
- }
- else
- {
- Console.WriteLine("Invalid input.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement