Skip to content

BorkedFork/cst116-intro-programming-loan-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Loan Calculator with Amortization Schedule

A C++ console application that calculates monthly loan payments and displays a complete amortization schedule.

Description

This loan calculator computes monthly payment amounts for loans and generates a detailed amortization table showing the breakdown of principal and interest for each payment period. The program demonstrates financial mathematics and proper formatting of tabular output in C++.

Features

  • Monthly Payment Calculation: Computes accurate monthly payments using loan amortization formula
  • Amortization Schedule: Displays complete payment breakdown for entire loan duration
  • Multi-file Architecture: Separates calculation logic from display logic
  • Precise Calculations: Uses double precision for accurate financial computations
  • Formatted Output: Professional table formatting with proper alignment

Technologies Used

  • C++
  • Standard Template Library (STL)
  • <cmath> for mathematical calculations
  • <iomanip> for formatted output
  • Visual Studio project structure
  • Header files for code organization

Formula

The monthly payment is calculated using:

M = (P × r) / (1 - (1 + r)^(-n))

Where:
M = Monthly payment
P = Principal amount
r = Monthly interest rate (annual rate / 12 / 100)
n = Total number of months

Building and Running

Prerequisites

  • C++ compiler (Visual Studio recommended)
  • Windows operating system

Build Instructions

  1. Open the solution file in Visual Studio
  2. Build the solution (F7 or Build > Build Solution)
  3. Run the executable or press F5

Usage

  1. Run the program
  2. Enter the principal loan amount
  3. Enter the annual interest rate (as a percentage, e.g., 5.8)
  4. Enter the loan duration in years
  5. View the monthly payment and complete amortization schedule

Example Output

Month   Principal    Interest    Balance
-----   ---------    --------    -------
  1     $425.30      $242.67    $49,574.70
  2     $427.36      $240.61    $49,147.34
  3     $429.43      $238.54    $48,717.91
...

File Structure

  • calcDisplay.cpp: Contains calculation and display functions
  • calcDisplay.h: Header file with function declarations
  • main.cpp: Program entry point and user interaction

Author

Christian Burnett

About

C++ loan amortization calculator with monthly payment schedules

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •