From 801e5f538875e346ea025bec9ce5cddd7b04b6d1 Mon Sep 17 00:00:00 2001 From: BogachanKarabiyik Date: Mon, 8 Sep 2025 11:40:06 -0700 Subject: [PATCH 1/8] fix division by 0, closes #61 --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 958ba61..d71b7f7 100644 --- a/main.cpp +++ b/main.cpp @@ -15,7 +15,10 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; + + if (y != 0) + cout << "Division: " << x / y << endl; + cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl; From 417c0cf01eddc01e4d476d22c15e3e360e05d400 Mon Sep 17 00:00:00 2001 From: Bogachan Karabiyik Date: Wed, 17 Sep 2025 11:35:52 -0700 Subject: [PATCH 2/8] Create README.md --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9dfe6ee --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![Build C++](https://github.com/ChicoState/FirstIO/actions/workflows/actions.yml/badge.svg)](https://github.com/ChicoState/FirstIO/actions/workflows/actions.yml) From 782d74ca04efee6dce15c7b148d8f542e7ad8bd8 Mon Sep 17 00:00:00 2001 From: Bogachan Karabiyik Date: Wed, 17 Sep 2025 11:39:13 -0700 Subject: [PATCH 3/8] Create build.yml --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1ddab56 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: "**" + pull_request: + branches: [ main ] + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y -f build-essential g++ cmake + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: make clean && make From 9e5dded17ecfce8193d557c675cd25cc2caada59 Mon Sep 17 00:00:00 2001 From: Bogachan Karabiyik Date: Wed, 17 Sep 2025 11:40:43 -0700 Subject: [PATCH 4/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9dfe6ee..cbbacf4 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -[![Build C++](https://github.com/ChicoState/FirstIO/actions/workflows/actions.yml/badge.svg)](https://github.com/ChicoState/FirstIO/actions/workflows/actions.yml) +[![Build C++](https://github.com/ChicoState/FirstIO/actions/workflows/actions.yml/badge.svg)](https://github.com/BogachanKarabiyik/MyFirstExample/actions/workflows/actions.yml) From c1d0a737e748f7c9b9c59550892a907726893209 Mon Sep 17 00:00:00 2001 From: Bogachan Karabiyik Date: Wed, 17 Sep 2025 11:41:11 -0700 Subject: [PATCH 5/8] Update main.cpp --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 8ff9ce9..cd96926 100644 --- a/main.cpp +++ b/main.cpp @@ -3,7 +3,7 @@ int main() { - std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + std::cout << "THE FIRST EXAMPLE MATH DISLAY!\n"; std::cout << "Hi, please enter two whole numbers: "; int x,y; From 9dc19640c943ddb42bbe2dd7e583cff2a049d127 Mon Sep 17 00:00:00 2001 From: Bogachan Karabiyik Date: Wed, 17 Sep 2025 11:46:30 -0700 Subject: [PATCH 6/8] Update build.yml --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ddab56..b6bd50f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,4 +20,3 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build project - run: make clean && make From 79c99096198b24225d8c2ef406fc962f22007d28 Mon Sep 17 00:00:00 2001 From: Bogachan Karabiyik Date: Wed, 17 Sep 2025 11:47:19 -0700 Subject: [PATCH 7/8] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6bd50f..6e67cf3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,3 +20,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build project + run: From f0d4b57e82a553ba0594ede659a1d295d05f5e2e Mon Sep 17 00:00:00 2001 From: Bogachan Karabiyik Date: Wed, 17 Sep 2025 11:47:51 -0700 Subject: [PATCH 8/8] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e67cf3..31a571a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,4 +20,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build project - run: + run: ls