Investment Calculator with Advanced Analytics
A comprehensive Java Swing application for calculating compound interest investments with interactive charts, detailed schedules, multi-currency support, and automated testing infrastructure.
Project Overview
This investment calculator provides users with powerful tools to plan their financial future. It features a modern GUI built with Java Swing and FlatLaf look-and-feel, offering comprehensive investment calculations with visual representations and detailed breakdowns. The application supports various compounding frequencies, contribution schedules, negative contributions (withdrawals), and includes a robust testing suite with CI/CD pipeline.
Key Features
- Compound interest calculations with multiple frequencies (daily, weekly, monthly, quarterly, annually)
- Interactive investment growth charts and pie chart breakdowns showing final amount composition
- Support for negative contributions (withdrawals) to model money taken out of investments
- Support for regular contributions with flexible timing (beginning/end of period)
- Multi-currency support (USD, EUR, GBP, JPY, CAD, AUD)
- Comprehensive annual and monthly investment schedules with dynamic labeling
- Chart export functionality (PNG/JPEG) with full-screen viewing mode
- Automated test suite with detailed input/output validation
- GitHub Actions CI/CD pipeline for continuous integration
- Comprehensive documentation including calculation methodology
Technical Implementation
The application uses a modular architecture with separate components for calculations, charting, and UI. It implements the Model-View-Controller pattern with dedicated classes for investment engine calculations, chart generation using JFreeChart, and a clean Swing-based user interface. The calculation engine uses BigDecimal arithmetic for financial precision and includes comprehensive validation against known mathematical formulas.
Technologies Used
Java 11+
Java Swing
FlatLaf Look and Feel
JFreeChart
BigDecimal Precision
Maven Build System
JUnit 5 Testing
GitHub Actions CI/CD
MVC Architecture
Advanced Features
- Dual Chart System: Growth over time charts and pie charts showing investment breakdown (starting amount, contributions, interest earned)
- Withdrawal Support: Handle negative contributions with appropriate UI feedback and calculations
- Precision Calculations: Uses BigDecimal with 10 decimal places to avoid rounding errors in financial calculations
- Comprehensive Testing: Automated test suite validating calculations against known formulas with detailed input/expected/actual output
- CI/CD Pipeline: GitHub Actions workflow for automated testing on every push and pull request
- Documentation: Detailed explanation of calculation differences between investment calculators and methodology transparency
- Export Capabilities: Save high-resolution chart images for reports and presentations
- Professional Architecture: Clean separation of concerns with testable, maintainable code structure
Quality Assurance
- Automated Testing: Comprehensive JUnit test suite covering edge cases and mathematical validation
- Continuous Integration: GitHub Actions pipeline ensuring code quality on every commit
- Calculation Transparency: Detailed documentation explaining methodology and potential discrepancies with other calculators
- Input Validation: Robust error handling and user input validation with clear error messages
×