This Java project approximates the value of π (Pi) using the Leibniz series. The program takes user input to determine the number of terms (operands) for the approximation and calculates the result using a simple loop.
- Uses the Leibniz formula to approximate π:
[\pi \approx 4 \times \sum_{n=0}^{\infty} \frac{(-1)^n}{2n+1}] - User-friendly input via
JOptionPanefor entering the number of terms. - Error handling to ensure valid numeric input.
- Prevents program execution with excessively large input values, maintaining performance.
- Displays the approximation result in a graphical message dialog.
Main.java: Core logic for input handling, Leibniz series calculation, and result display.
Feedback and suggestions are welcome! <3