From f5d44dc888e224fa22cbbe82461e15c77d99443f Mon Sep 17 00:00:00 2001 From: Raquel Zamudio Date: Wed, 28 Jan 2026 11:42:43 -0800 Subject: [PATCH 1/3] Prevents divide by zero, resolves #61 --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index a495fc94..460330f6 100644 --- a/main.cpp +++ b/main.cpp @@ -14,6 +14,7 @@ int main() std::cout << "Multiplication: " << x * y << std::endl; std::cout << "Division: " << x / y << std::endl; std::cout << "Remainder: " << x % y << std::endl; + if(x = 0){ std::cout<<"Cannot divide by 0"<< std::endl;} std::cout << "Square Root: " << sqrt(x) << std::endl; std::cout << "Square: " << pow(x, y) << std::endl; From d52c1a71e235b16b181e69c0f218c0724ab0dfe9 Mon Sep 17 00:00:00 2001 From: Raquel Zamudio Date: Wed, 11 Feb 2026 13:03:30 -0800 Subject: [PATCH 2/3] pushing actions.yml file --- .github/workflows/actions.yml | 23 +++++++++++++++++++++++ main.cpp | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/actions.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 00000000..e21693b8 --- /dev/null +++ b/.github/workflows/actions.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: g++ -std=c++17 main.cpp \ No newline at end of file diff --git a/main.cpp b/main.cpp index ed5965ca..14514f64 100644 --- a/main.cpp +++ b/main.cpp @@ -8,7 +8,7 @@ using std::cout; int main() { cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - cout << "Hi, please enter two whole numbers: "; + cout << "Hi, please enter two whole numbers please: "; int x,y; From 0a3351917a7205e2104ed2f177d51ceb45dd909b Mon Sep 17 00:00:00 2001 From: Raquel Zamudio Date: Wed, 11 Feb 2026 13:21:19 -0800 Subject: [PATCH 3/3] readme file --- 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..3b4c2a72 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![Build C++](https://github.com/msRaquel/MyFirstExample/actions/workflows/actions.yml/badge.svg)](https://github.com/msRaquel/MyFirstExample/actions/workflows/actions.yml) \ No newline at end of file