using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static private int age;
static private int fear;
static void Main(string[] args)
{
Console.WriteLine("Enter your age");
int.TryParse(Console.ReadLine(),out age);
if (age > 0 || age < 0 || age == 0)
{
Console.WriteLine("Enter your most Feared Age");
int.TryParse(Console.ReadLine(),out fear);
if (age > 0 || age < 0 || age == 0)
{
Console.WriteLine(CheckYearsApart(age, fear));
}
else
{
Console.WriteLine("You must enter an integer");
}
}
else
{
Console.WriteLine("You must enter an integer...");
}
Console.WriteLine("Press any key to continue...");
Console.ReadLine();
}
static private string CheckYearsApart(int age, int fear)
{
if (age > fear)
{
int apart = age - fear;
return "You have lived "+apart+" years past the fear...";
}
else if (age < fear)
{
int apart = Math.Abs(age - fear);
return "You are " + apart + " years away from your feared age...";
}
else if (age == fear)
{
return "YOU ARE IN YOUR AGE OF FEAR!!!";
}
return "This shouldn't ever happen... Uh oh.";
}
}
}