Data Science · Beginner · 50 points · about 90 min · due 20 Nov 2026
Compound interest allows an investment to grow by earning interest on both its original principal and previously accumulated interest. The final value depends on the principal, interest rate, compounding frequency, and investment duration.
In this challenge, you will build a compound interest calculator that determines the future value of an investment and the total interest earned over a specified period. The calculator must support different compounding frequencies and present the results clearly.
You will use supplied examples to verify the calculations and demonstrate how changes in interest rates, investment periods, and compounding frequency affect investment growth.
The challenge focuses on mathematical accuracy, reliable input handling, and clear presentation of financial results.
Stuck? Open a hint. Try the first one before the next.
Convert the annual nominal interest rate into a periodic interest rate before calculating.
Multiply the number of years by the number of compounding periods per year to determine the total periods.
The future value includes the original principal; the interest earned does not.
A zero interest rate should produce a future value equal to the original principal.
Avoid rounding intermediate values before the final result is calculated.
Develop a functional compound interest calculator that accepts an initial principal, an annual nominal interest rate, a compounding frequency, and an investment duration, then calculates the future investment value and total interest earned.
Financial mathematics, Formula implementation, Numerical accuracy, Input validation and error handling, Testing and debugging, Technical documentation
A strong submission must demonstrate all of the following:
Mathematical accuracy — 35%: Correctly applies the compound interest formula and calculates future value and total interest earned.
Compounding frequency and duration — 20%: Correctly determines the periodic rate and total number of compounding periods.
Input validation and boundary cases — 15%: Handles zero interest, invalid values, and unsupported frequencies appropriately.
Testing — 15%: Includes at least five test cases with expected and actual results.
Output clarity — 10%: Presents all financial inputs and results clearly, with monetary amounts displayed to two decimal places.
Documentation and usability — 5%: Explains the formula, assumptions, and how to run the solution.