To determine how many years \( n \) it takes for the number of students to reach 365, we can set the function \( f(n) = 240(1.15)^n \) equal to 365 and solve for \( n \):
\[
240(1.15)^n = 365
\]
Now, divide both sides by 240:
\[
(1.15)^n = \frac{365}{240}
\]
Calculating the right side:
\[
\frac{365}{240} \approx 1.5208333
\]
Next, we take the logarithm of both sides to solve for \( n \):
\[
n \log(1.15) = \log(1.5208333)
\]
Now, solving for \( n \):
\[
n = \frac{\log(1.5208333)}{\log(1.15)}
\]
Calculating the logarithms:
\[
n \approx \frac{0.1828}{0.0672} \approx 2.72
\]
Since \( n \) must be a whole number, we round \( n \) to 3 years.
Thus, the number of years it takes for the number of students to reach 365 is approximately:
C. 3 years.