using System;
class Program
{
public static int getInt(string text, int low, int high)
{
int answer;
do
{
Console.Write(text);
answer = Convert.ToInt32(Console.ReadLine());
if ((answer > high))
Console.WriteLine("Not a valid answer. Must be no more than 150");
if ((answer < low))
Console.WriteLine("Not a valid answer. Must be no less than 0");
} while ((answer < low) || (answer > high));
return answer;
}
static void Main()
{
int age = getInt("Enter your age: ", 0, 150);
Console.WriteLine("The age is {0}", age);
}
}