This repository features a professional-grade Scientific Calculator developed for terminal use. It is available in two versions: a high-performance C++ implementation and a versatile Python script.
Since C++ is a compiled language, you need a "translator" (compiler) to turn the code into an application.
- Download the Toolchain — Go to MSYS2.org and download the installer.
- Installation — Run the setup and type:
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
- Environment Variables — Add
C:\msys64\ucrt64\binto your System Path.
Python is an interpreted language, so you only need the Python runtime.
- Download — Get the latest version from Python.org.
- Verification — Open CMD and type
python --versionto ensure it's installed.
- Navigate to your project folder:
cd Desktop\CalcProject - Build the App:
g++ main.cpp -o ScientificCalc
- Run:
ScientificCalc
- Navigate to your project folder:
cd Desktop\CalcProject - Run Directly:
python calculator.py
Both versions use a Command-First logic. Type the command, hit Enter, then provide the numbers when prompted.
| Command | Action | Example |
|---|---|---|
| Numbers | Directly type a number | 10 → Sets result to 10 |
| Operators | +, -, *, / |
+ [Enter] 5 → Adds 5 |
| Trig | sin, cos, tan |
sin [Enter] 90 |
| Advanced | root (n-th root) |
root [Enter] 8 [Enter] 3 |
| Bases | base |
base [Enter] 10 (Hex/Bin) |
| Settings | mode |
Switch DEGREE / RADIAN |
| Control | menu or clear |
Show help or Reset |
- Case Sensitivity — Both versions are user-friendly;
SIN,sin, orSinwill all work. - Precision — Results are calculated with high precision and displayed with 6 decimal places.
- Language Choice — Use the C++ version for maximum execution speed or the Python version for easier code readability and cross-platform portability.
- Safety — Includes built-in protection against "Division by Zero" and invalid mathematical inputs.