I think you have been asked to create four functions, each with different names.... e.g. calculate_Maturity4, calculate_Maturity5, calculate_Maturity6, ....

and each function will have separate rates... calculateMaturity4 will be return a value calculated with rate = 4%

e.g. it will return principal * pow((1 + 4/100), years)....

Hope you got it

Dennis