From f836d175170b68bd66d1422b48b821a528742fc7 Mon Sep 17 00:00:00 2001 From: InsertUzername Date: Mon, 31 Aug 2026 11:38:40 -0700 Subject: [PATCH 1/4] fix: divide by zero problem, close #61 --- main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 5411e7a3..2434ca99 100644 --- a/main.cpp +++ b/main.cpp @@ -16,8 +16,14 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; - cout << "Remainder: " << 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 4ae3b2eeb0b48f7a389cb39a380553318d3b7f81 Mon Sep 17 00:00:00 2001 From: Kevin Buffardi Date: Tue, 1 Sep 2026 21:48:41 -0700 Subject: [PATCH 2/4] chore: explicitly name each library usage --- main.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/main.cpp b/main.cpp index 5411e7a3..a495fc94 100644 --- a/main.cpp +++ b/main.cpp @@ -1,25 +1,21 @@ #include #include -using std::endl; -using std::cin; -using std::cout; - int main() { - cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - cout << "Hi, please enter two whole numbers: "; + std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + std::cout << "Hi, please enter two whole numbers: "; int x,y; - cin >> x >> y; - cout << "Addition: " << x + y << endl; - cout << "Subtraction: " << x - y << endl; - cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; - cout << "Remainder: " << x % y << endl; - cout << "Square Root: " << sqrt(x) << endl; - cout << "Square: " << pow(x, y) << endl; + std::cin >> x >> y; + std::cout << "Addition: " << x + y << std::endl; + std::cout << "Subtraction: " << x - y << std::endl; + std::cout << "Multiplication: " << x * y << std::endl; + std::cout << "Division: " << x / y << std::endl; + std::cout << "Remainder: " << x % y << std::endl; + std::cout << "Square Root: " << sqrt(x) << std::endl; + std::cout << "Square: " << pow(x, y) << std::endl; return 0; } From 1b3c446df158f70d108ed06e983b3a7ebf2ad439 Mon Sep 17 00:00:00 2001 From: InsertUzername Date: Wed, 2 Sep 2026 11:40:51 -0700 Subject: [PATCH 3/4] Resolve conlfict with upstream main --- main.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/main.cpp b/main.cpp index 94a30e2d..23d2a8ce 100644 --- a/main.cpp +++ b/main.cpp @@ -8,31 +8,21 @@ int main() int x,y; -<<<<<<< HEAD - cin >> x >> y; - cout << "Addition: " << x + y << endl; - cout << "Subtraction: " << x - y << endl; - cout << "Multiplication: " << x * y << endl; + std::cin >> x >> y; + std::cout << "Addition: " << x + y << std::endl; + std::cout << "Subtraction: " << x - y << std::endl; + std::cout << "Multiplication: " << x * y << std::endl; if(y == 0) { - cout << "Dividing by zero is not a number." << endl; + std::cout << "Dividing by zero is not a number." << std::endl; } else { - cout << "Division: " << x / y << endl; - cout << "Remainder: " << x % y << endl; + std::cout << "Division: " << x / y << std::endl; + std::cout << "Remainder: " << x % y << std::endl; } - cout << "Square Root: " << sqrt(x) << endl; - cout << "Square: " << pow(x, y) << endl; -======= - std::cin >> x >> y; - std::cout << "Addition: " << x + y << std::endl; - std::cout << "Subtraction: " << x - y << std::endl; - std::cout << "Multiplication: " << x * y << std::endl; - std::cout << "Division: " << x / y << std::endl; - std::cout << "Remainder: " << x % y << std::endl; + std::cout << "Square Root: " << sqrt(x) << std::endl; std::cout << "Square: " << pow(x, y) << std::endl; ->>>>>>> main return 0; } From 6e3c7cdb88e1283251045d5bca92ec7e2a4efac2 Mon Sep 17 00:00:00 2001 From: InsertUzername Date: Mon, 21 Sep 2026 11:34:17 -0700 Subject: [PATCH 4/4] Created CI configuration --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 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..2ef0f475 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: Build C++ + +on: + push: + branches: "**" + pull_request: + branches: [ main ] + workflow_dispatch: + +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@v7 + - name: Build project + run: g++ -std=c++17 main.cpp \ No newline at end of file