From TRCCompSci - AQA Computer Science
The Code
static int GetHowLongToRun()
{
int Years = 0;
Console.WriteLine("Welcome to the Plant Growing Simulation");
Console.WriteLine();
Console.WriteLine("You can step through the simulation a year at a time");
Console.WriteLine("or run the simulation for 0 to 5 years");
Console.WriteLine("How many years do you want the simulation to run?");
Console.Write("Enter a number between 0 and 5, or -1 for stepping mode: ");
Years = Convert.ToInt32(Console.ReadLine());
return Years;
}
Explanation