https://github.com/123aiden-g/swift-cli-calculator
A simple command-line calculator written in Swift. My first Swift project.
https://github.com/123aiden-g/swift-cli-calculator
beginner-friendly calculator cli learning project swift
Last synced: 8 months ago
JSON representation
A simple command-line calculator written in Swift. My first Swift project.
- Host: GitHub
- URL: https://github.com/123aiden-g/swift-cli-calculator
- Owner: 123Aiden-G
- Created: 2025-09-24T16:21:11.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-24T17:14:46.000Z (9 months ago)
- Last Synced: 2025-10-05T00:18:16.947Z (9 months ago)
- Topics: beginner-friendly, calculator, cli, learning, project, swift
- Language: Swift
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swift CLI Calculator

A simple command-line calculator built in Swift.
This is my first Swift project — a small but fun way to learn the language.
---
## Features
- Basic arithmetic: addition, subtraction, multiplication, and division
- Input validation (handles invalid numbers and division by zero)
- Clean CLI interface
- Easily extendable for new operations
---
## Usage
1. Clone the repository:
```bash
git clone https://github.com/YOUR_USERNAME/swift-cli-calculator.git
cd swift-cli-calculator
```
2. Run the calculator:
```bash
swift main.swift
```
**Example:**
```
Welcome to Swift CLI Calculator!
Enter first number: 5
Enter second number: 3
Choose operation (+, -, *, /): *
Result: 15
```
---
## Project Structure
```
swift-cli-calculator/
│── main.swift # Source code
│── README.md # Project documentation
│── .gitignore # Ignored files
```
---
## Roadmap
- Add support for more operations (modulus, power, square root)
- Allow continuous calculations until user exits
- Format results with decimals
- Add tests
---
## License
This project is open-source and available under the MIT License.