Difference between revisions of "GetHowLongToRun - AS 2017"
(Created page with "==The Code== <syntaxhighlight lang=Csharp> static int GetHowLongToRun() { int Years = 0; Console.WriteLine("Welcome to the Plant Growing Simulation"); Console.Wri...") |
(No difference)
|
Latest revision as of 09:19, 3 March 2017
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;
}