public static void Main()
Console.WriteLine("Time Elapsed");
Console.Write("Enter time in hour(s) (0-24): ");
inputHours = Console.ReadLine();
if (Int32.TryParse(inputHours, out hours) == true)
totalTime = hours * 3600;
Console.WriteLine("The equivalent time in seconds is {0:0,0}", totalTime);
else if (hours < 0 || hours > 24)
Console.WriteLine("Invalid input.Range of hours should only be from (0 - 24)");
Console.Write("Enter time in minute(s) (0 - 60): ");
inputMinutes = Console.ReadLine();
if (Int32.TryParse(inputMinutes, out minutes) == true)
totalTime = (hours * 3600) + (minutes * 60);
Console.WriteLine("The equivalent time in seconds is {0:0,0}", totalTime);
else if (minutes < 0 || minutes > 60)
Console.WriteLine("Invalid input.Range of minutes should only be from (0 - 60)");
Console.Write("Enter time in second(s) (0 - 60): ");
inputSeconds = Console.ReadLine();
if (Int32.TryParse(inputSeconds, out seconds) == true)
totalTime = (hours * 3600) + (minutes * 60) + seconds;
if (seconds < 0 || seconds > 60)
Console.WriteLine("Invalid input.Range of seconds should only be from (0 - 60)");
Console.WriteLine("The equivalent time in seconds is: {0:0}" , totalTime);
Console.WriteLine("The equivalent time in seconds is: {0:0,0}", totalTime);
Console.WriteLine("Invalid input. Numeric Values only.");
Console.WriteLine("Invalid input. Numeric Values only.");
Console.WriteLine("Invalid input. Numeric Values only.");
Console.WriteLine("Would you like to try again? Enter [Y]/[y] if yes and any key if not: ");
userResponse = Console.ReadLine();
} while (userResponse == "Y" || userResponse == "y");
Console.WriteLine("Program terminated. Please restart for the next user.");