From 45af434370b18379ac936ca789772a66ba46ed27 Mon Sep 17 00:00:00 2001 From: "Anthony C." Date: Mon, 31 Aug 2026 11:36:31 -0700 Subject: [PATCH 1/3] fixed Nan error --- main.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/main.cpp b/main.cpp index 5411e7a3..727ad27a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,25 +1,29 @@ -#include #include +#include -using std::endl; using std::cin; using std::cout; +using std::endl; + +int main() { + cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; + cout << "Hi, please enter two whole numbers: "; -int main() -{ - cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - cout << "Hi, please enter two whole numbers: "; + int x, y; - int x,y; + cin >> x >> y; - cin >> x >> y; - cout << "Addition: " << x + y << endl; - cout << "Subtraction: " << x - y << endl; - cout << "Multiplication: " << x * y << endl; + cout << "Addition: " << x + y << endl; + cout << "Subtraction: " << x - y << endl; + cout << "Multiplication: " << 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; + } + cout << "Square Root: " << sqrt(x) << endl; + cout << "Square: " << pow(x, y) << endl; - return 0; + return 0; } From 4ae3b2eeb0b48f7a389cb39a380553318d3b7f81 Mon Sep 17 00:00:00 2001 From: Kevin Buffardi Date: Tue, 1 Sep 2026 21:48:41 -0700 Subject: [PATCH 2/3] 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 54dc3a530d27b1470f3b48638f2b94b6dd3a50fe Mon Sep 17 00:00:00 2001 From: "Anthony C." Date: Mon, 21 Sep 2026 11:36:12 -0700 Subject: [PATCH 3/3] added build.yaml file --- .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..94fa04c0 --- /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