Calculation of interest and amount invested