From b32daa1b01234e0390ae21a49846e005e7bdeda8 Mon Sep 17 00:00:00 2001 From: RezDead Date: Mon, 2 Feb 2026 12:18:25 -0800 Subject: [PATCH 1/4] Added message if dividing by zero, resolves #61 --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 5411e7a3..9af412c7 100644 --- a/main.cpp +++ b/main.cpp @@ -16,7 +16,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 << "Dividing by zero is not a number" << endl; + else + cout << "Division: " << x / y << endl; cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl; From fb2438a888391eaf323da2e4e7db1954659af309 Mon Sep 17 00:00:00 2001 From: RezDead Date: Wed, 11 Feb 2026 11:48:19 -0800 Subject: [PATCH 2/4] Added build workflow --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 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 00000000..4f171b56 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: Build C++ + +on: + push: + branches: [ main , ci/cd ] + +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: g++ -std=c++17 main.cpp \ No newline at end of file From fe6395a138c83dafc0a030994d552f119275cdec Mon Sep 17 00:00:00 2001 From: RezDead Date: Wed, 11 Feb 2026 11:49:11 -0800 Subject: [PATCH 3/4] Added error to main --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 9af412c7..496eda3e 100644 --- a/main.cpp +++ b/main.cpp @@ -7,7 +7,7 @@ using std::cout; int main() { - cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + cout << "THE FIRST EXAMPLE MATH DISPLAY!\n" cout << "Hi, please enter two whole numbers: "; int x,y; From 9906dc3e83335e92c4bad33cb6ca9ac5c85a128b Mon Sep 17 00:00:00 2001 From: RezDead <67170240+RezDead@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:51:44 -0800 Subject: [PATCH 4/4] Add build status badge to README --- 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 00000000..0f115060 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![Build C++](https://github.com/RezDead/MyFirstExample/actions/workflows/build.yml/badge.svg)](https://github.com/RezDead/MyFirstExample/actions/workflows/build.yml)