function to calculate simple interest seperated