{"id":24762043,"url":"https://github.com/pranavh-2004/polycalc","last_synced_at":"2026-04-10T12:31:25.999Z","repository":{"id":270470242,"uuid":"910412140","full_name":"Pranavh-2004/PolyCalc","owner":"Pranavh-2004","description":"\"PolyCalc (Polyglot Calculator) demonstrates core programming concepts across multiple languages, embodying the simplicity and versatility of a calculator as the perfect ‘hello world’ program for learning any new language.”","archived":false,"fork":false,"pushed_at":"2025-01-01T06:03:34.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T13:17:05.784Z","etag":null,"topics":["basic-learning","basic-programming","best-practices","calculator","cross-language","muti-language","open-source","programming-languages"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pranavh-2004.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-31T07:47:14.000Z","updated_at":"2025-01-05T10:56:31.000Z","dependencies_parsed_at":"2024-12-31T12:27:49.971Z","dependency_job_id":"a04c0773-7dbe-4e7d-b14f-c95cae83b39a","html_url":"https://github.com/Pranavh-2004/PolyCalc","commit_stats":null,"previous_names":["pranavh-2004/polycalc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pranavh-2004/PolyCalc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranavh-2004%2FPolyCalc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranavh-2004%2FPolyCalc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranavh-2004%2FPolyCalc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranavh-2004%2FPolyCalc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pranavh-2004","download_url":"https://codeload.github.com/Pranavh-2004/PolyCalc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pranavh-2004%2FPolyCalc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31642678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic-learning","basic-programming","best-practices","calculator","cross-language","muti-language","open-source","programming-languages"],"created_at":"2025-01-28T19:20:15.574Z","updated_at":"2026-04-10T12:31:25.980Z","avatar_url":"https://github.com/Pranavh-2004.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **PolyCalc (short for Polyglot Calculator)**\n\n**PolyCalc** is a multi-language arithmetic calculator project aimed at mastering the basics of various programming languages. The project implements a simple calculator in multiple languages, including Python, C, C++, Go, TypeScript, JavaScript, Bash, PowerShell, PHP and MATLAB demonstrating the fundamentals of input handling, arithmetic operations, and formatted output.\n\n---\n\n## **Features**\n\n- 🧮 Performs basic arithmetic operations: addition (`+`), subtraction (`-`), multiplication (`*`), and division (`/`).\n- ✅ Input validation for numbers and operators.\n- 🎯 Displays results with two decimal precision.\n- 🛠 Modular and structured code for each language, showcasing best practices.\n\n---\n\n## **Languages Implemented**\n\n- **Python**\n- **C**\n- **Go**\n- **TypeScript**\n- **JavaScript**\n- **Bash**\n- **C++**\n- **PowerShell**\n- **PHP**\n- **MATLAB**\n\n---\n\n## **Getting Started**\n\nFollow the instructions below to run the calculator in your preferred language.\n\n### **Python**\n\n1. Install Python 3.x.\n2. Run the program:\n   ```bash\n   python simple_calculator.py\n   ```\n\n### **C**\n\n1. Use GCC to compile:\n   ```bash\n   gcc simple_calculator.c -o simple_calculator\n   ```\n2. Run the program:\n   ```bash\n   ./simple_calculator\n   ```\n\n### **Go**\n\n1. Install Go.\n2. Run the program:\n   ```bash\n   go run simple_calculator.go\n   ```\n\n### **Typescript**\n\n1. Install dependencies: (shown wrt pnpm as i used it for this project)\n   ```bash\n   pnpm install\n   ```\n2. Compile the code:\n   ```bash\n   pnpm tsc\n   ```\n3. Run the compiled code:\n   ```bash\n   node simple_calculator.js\n   ```\n\n### **Javascript**\n\n1. Run directly with Node.js:\n   ```bash\n   node simple_calculator.js\n   ```\n\n### **Bash Shell**\n\n1. Make the script executable:\n   ```bash\n   chmod +x simple_calculator.sh\n   ```\n2. Run the program:\n   ```bash\n   ./simple_calculator.sh\n   ```\n\n### **C++**\n\n1. Use G++ to compile:\n   ```bash\n   g++ simple_calculator.cpp -o simple_calculator\n   ```\n2. Run the program:\n   ```bash\n   ./simple_calculator\n   ```\n\n### **PowerShell**\n\n1. Make the script executable:\n   ```powershell\n   Set-ExecutionPolicy RemoteSigned -Scope CurrentUser\n   ```\n2. Run the script:\n   ```powershell\n   .\\simple_calculator.ps1\n   ```\n\n### **PHP**\n\n1. Run the PHP script using the PHP command line:\n   ```powershell\n   php simple_calculator.php\n   ```\n\n### **MATLAB**\n\n1. Open MATLAB by launching the MATLAB application\n2. Navigate to the Script’s Directory\n3. Run the MATLAB script:\n   ```bash\n   simple_calculator\n   ```\n\n## Project Structure\n\nThe project is organized into the following directories and files:\n\n```plaintext\nPolyCalc/\n├── Python/\n│   └── simple_calculator.py\n├── C/\n│   └── simple_calculator.c\n├── C++/\n│   └── simple_calculator.cpp\n├── Go/\n│   └── simple_calculator.go\n├── TypeScript/\n│   └── simple_calculator.ts\n├── JavaScript/\n│   └── simple_calculator.js\n├── Bash/\n│   └── simple_calculator.sh\n├── PowerShell/\n│   └── simple_calculator.ps1\n├── PHP/\n│   └── simple_calculator.php\n├── MATLAB/\n│   └── simple_calculator.m\n├── README.md\n└── .gitignore\n```\n\n## **Contributing**\n\nContributions are welcome! If you’d like to add more languages or features:\n\n1. **Fork this repository.**\n2. **Create a new branch:**\n   ```bash\n   git checkout -b feature/new-language\n   ```\n3. **Commit your changes:**\n   ```bash\n   git commit -m \"Add [language] implementation\"\n   ```\n4. **Push to the branch:**\n   ```bash\n   git push origin feature/new-language\n   ```\n5. **Submit a pull request.**\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavh-2004%2Fpolycalc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpranavh-2004%2Fpolycalc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavh-2004%2Fpolycalc/lists"}