I'm still very new to C#, but have some experience with scripting languages such as javaScript, PHP, and VB.Net.
My question is how do I call a method from another method? Below is a chunk of code from my program. I want this method to evaluate a value and two execute one of the two methods based on the result. I'm just nit getting some of the basic fundamentals of this language and am hoping to remedy that.
static void which(int startYear, int baseYear, int StartPopulation)
{
if(startYear > baseYear)
{
startPopulation = StartPopulation(int counter, double increase, double currentPopulation)
}
else(startYear < baseYear)
{
startPopulation = StartPopulationB(int counter, double increase, double currentPopulation);
{
return startPopulation;
}
}
The errors I'm getting are:
(1)Error 2 Method must have a return type
(2)Error 3 A namespace does not directly contain members such as fields or methods
Note: There aren't any user classes in this program.