Compound Interest Calculator

compoundinterestA few months back I decided to get back into C++, and what is better to practice than coding some tools that you can use yourself? So I decided to make a little tool to visualize the effect of compound interest using Qt 5.7. Qt made it very simple and straightforward to have a stacked bar graph (QStackedBarSeries) displayed with different bits of information:

  • Quarterly Interest (interest generated in each quarter)
  • Accumulated Interest (the total amount of interest generated)
  • Principal (the money you put yourself in for each quarter)
  • Quarterly Total (Principal + Accumulated Interest)

It was also pretty easy to implement some sliders (QSlider) for changing a few parameters:

  • Number of years
  • How much you add to your investments every month
  • Yearly average interest rate (after accounting for inflation)
  • Starting amount of money

The code can be found here. A couple of previews from the program:


It’s not really finished or perfect but it does the job!