Welcome to the GitHub Workshop Calculator Project!
This repository is designed to help you learn and practice Git version control, branching, collaboration, and merging workflows โ all while contributing simple code in Python or Java.
github-workshop/
โโโ README.md
โโโ python/
โ โโโ calculator.py
โ โโโ operations.py
โโโ java/
โโโ Calculator.java
โโโ Operations.java
Each folder contains a simple calculator app that performs basic arithmetic operations.
Participants can modify, extend, and experiment with Git workflows while improving the app.
- Navigate to the Python directory:
cd python- Run the calculator:
python calculator.py- Navigate to the Java directory:
cd java- Compile and run the program:
javac utils/Operations.java Calculator.java
java CalculatorEach participant should:
-
Create a new branch based on
dev.git checkout dev git pull git checkout -b feature-yourname
-
Make a meaningful code change:
- Add a new function (
modulus,power,average, etc.) - Fix a bug (e.g., divide-by-zero handling)
- Improve output formatting or add comments
- Add a new function (
-
Commit and push your changes:
git add . git commit -m "Added power function in operations.py" git push origin feature-yourname
-
Open a Pull Request on GitHub targeting
dev. -
Review and merge your pull request once approved.
Here are some ideas to extend the calculator:
- Add a power function:
a^b - Add a modulus function:
a % b - Add an average function:
(a + b) / 2 - Handle invalid input or string formatting
- Add user input support instead of hardcoded values
- Always create branches for new features or bug fixes.
- Use (conventional commits)[https://www.conventionalcommits.org/en/v1.0.0] for commit messages.
-
Fork this repository.
-
Create a feature branch:
git checkout -b feature-name
-
Commit your changes:
git commit -m "Add feature-name" -
Push to your branch and open a pull request.
-
Wait for review before merging.
This project is licensed under the MIT License.