This repository showcases a collection of fundamental mathematical algorithms and console-based numeric solvers, implemented in Java. The project culminates in the integration of logic with basic 2D graphics, utilizing the StdDraw library for visualizing numeric output, such as function plotting.
| File Name | Primary Function | Description |
|---|---|---|
| Ex1_1_1.java | Prime Number Checker | Determines if a given integer is a prime number. |
| Ex1_1_2.java | Twin Primes Generator | Finds and lists all twin prime pairs up to a user-defined limit. |
| Ex1_1_3.java | Generalized Prime Pairs | Finds and lists prime pairs with a user-defined gap (m-primes) up to a limit. |
| Ex1_2.java | Integer Arithmetic Simulation | Implements basic arithmetic (like multiplication) using only iterative operations. |
| Ex1_3.java | Quadratic Equation Solver (Console) | Solves the quadratic equation |
| Ex1_4.java | Repeated Solver | Allows the user to solve the quadratic equation in a loop until explicitly stopped. |
| Ex1_5.java | Quadratic Equation Plotter | Solves the quadratic equation and uses StdDraw to plot the resulting parabola on a 2D coordinate system. |
| StdDraw.java | 2D Drawing Library | The utility class providing drawing primitives (points, lines, shapes) for visualization. |
To compile all source files, ensure you are in the project root directory and run the following command. Note that StdDraw must be compiled first as it is a dependency.
# Compile all Java source files
javac *.java
# Run a specific program (e.g., the Parabola Plotter)
java Ex1_5