Financeit Interview Question

Solve this coding issue and debug problem.