From the result of the calculations, the total amount of the loan the student will pay back after the remaining 15 years is $103,624.7. This is very huge compared to $33,760 that he will pay if he decides to pay off his student loan now.
I recommend the student pay off his student loans rather than invest the money.
The reason for my recommendation is due to the fact that he would be paying a huge sum of $103,624.7 if he continues the loan which is far greater than the principal amount. Since he can pay off the loan from the inherited $40,000. This will be a better financial decision