Capgemini Interview Question

give me compound interest code