This project is a C++ application that calculates the monthly payments and the amortization schedule for a loan. It uses basic arithmetic functions for multiplication and division and provides a detailed loan breakdown for each month.
- Calculate monthly loan payments based on principal, interest rate, and loan duration.
- Generate an amortization schedule showing the breakdown of interest, principal payment, and remaining balance.
- Use custom functions for multiplication and division to perform the necessary calculations.
Before you begin, ensure that you have the following installed on your machine:
- A C++ compiler (e.g., GCC, Clang, MSVC)
- CMake (for building the project)
- A modern C++ standard (C++17 or higher)
-
Clone the repository
Clone this repository to your local machine using Git:
https://github.com/kanyutu707/amortizingengine.git
-
Navigate to the project directory
cd amortizingengine -
Create a build directory
It's recommended to create a build directory to keep the project organized.
mkdir build cd build -
Run CMake to generate the build files
cmake ..
-
Build the project
After generating the build files, compile the project:
cmake --build . -
Run the program
Once the build is complete, you can run the application:
./amortizingengine
The program will prompt you for the following inputs:
- Principal amount
- Interest rate (in percentage)
- Loan duration (in years)
It will then display the monthly payment and generate a loan amortization schedule showing the breakdown of each payment.
-
multiplier.hppandmultiplier.cpp: Defines themultiplierfunction, which takes two numbers and returns their product. This function is used to calculate the total number of months for the loan. -
divisor.hppanddivisor.cpp: Defines thedivisorfunction, which takes two numbers and returns the result of dividing the first by the second. This is used to calculate the interest and monthly payment breakdown. -
main.cpp: The main application logic. It reads input values from the user, performs calculations usingmultiplieranddivisor, and then generates and prints the loan amortization schedule.
Here is an example of how the program works:
Please enter the principal amount: 10000
Please enter the interest rate: 5
Please enter the years of loan: 5
Payment: 188.71
CM: 1 CI: 41.67 CP: 147.04 Bal: 9852.96
CM: 2 CI: 41.05 CP: 147.66 Bal: 9705.30
...
Loan payments complete
In this example:
- The loan principal is $10,000.
- The interest rate is 5%.
- The loan duration is 5 years (60 months).
The program calculates the monthly payment and prints out a breakdown of the interest and principal payments for each month, along with the remaining balance.
This project is licensed under the MIT License - see the LICENSE file for details.