Planning long-term investments can be difficult without understanding how contributions and returns compound over time. This project is a TypeScript-based investment calculator that simulates how an investment grows year by year using an initial deposit, annual contributions, and an expected annual return rate. The program calculates the total investment value, cumulative contributions, and total interest earned for each year of the investment period.
The calculator includes input validation to ensure realistic financial parameters and outputs structured yearly results to the console. By leveraging TypeScript’s strong typing, the project ensures safer calculations and cleaner code structure through well-defined interfaces for input data and output results. This makes it a great example project for developers learning TypeScript fundamentals, financial calculations, and basic simulation logic.
🚀 Technologies Used
TypeScript
Node.js
Console-based output
Basic financial calculation logic
📊 Key Features
Calculates compound growth annually
Tracks total contributions vs. interest earned
Provides year-by-year breakdown
Includes input validation for financial values
Uses TypeScript interfaces and types for safety
📂 Example Output
Year 1
Total: 5900
Total Contributions: 500
Total Interest Earned: 400
———————-
Year 2
Total: 6872
Total Contributions: 1000
Total Interest Earned: 872
———————-





