This is a mortgage calculator I made. I took the user’s mortgage cost, time, rate, and interest to determine the rate (monthly or yearly) payment. It also prints the final info nicely including duration, total payment, total interest, total principal, and rate payment. It asks the user if they want an Amortization Table and prints one if they do. If the user pays monthly, it will total everything after each year and print it each time. It will also let the user specify what month they start, and include each month in your time period so they know what month they are in. I have already written posts about the project if you want to read about my project, the source code, and the program being run.
For my final programming project, I didn’t have to implement many new things in order to complete my project. All of the code was pretty much accomplished in the shell, and that is where everything printed out. I only had to learn one thing, which was the PrettyTable module. I needed to download this on my laptop in order to use it in my program. This module gave me a code and system so I could create the Mortgage Amortization Table. I wanted to use it so I could print all the information in a nice table and give the user everything they needed the whole length of their loan.
I did have to learn quite a bit about mortgages and how to calculate the periodic payments as well as the interest. I didn’t know how it all worked so I needed to research quite a bit to understand it. I found the formula but needed to understand what it was doing. For the interest, there were many different formulas for different interests so I had to find one at a fixed rate and use that specific one. After that, I pretty much figured out how to calculate the principal and interest for each payment on my own. The math became simpler and when I used a for loop, the code became simpler too.
This is a part of my code that I’m proud of. I had to use different for and while loops in order to create the table to use the months and print the totals each year. This also gave the user the principal and interest each time. I am proud of it because I thought it was pretty cool to just put in these loops and get the effect. I’m proud of how I figured this out so it ran cleanly and gave the user everything they wanted.
This part of my code is a little cringy. This part shows how I found out what month the user started the loan. I feel like I could have made this a little different and better. I made a list of the months and then did things like subtracting the number given to find the index which would give me a month. I think there was an easier and more efficient way to do this instead of how I did it. If I had more time I would try to find a better way to do this.