Ciara O'Hara wrote:I am getting the error: "This method must return a result of type double", though to me it looks like I am returning double (A), so I'm confused.
The compiler isn't clever enough to know that you will always enter the for loop, therefore it is complaining that, if the for loop is not executed, there is no return statement.
Having said that, why have you got a for loop anyway ? It returns every time during the first iteration, so your code is basically the equivalent of