From 3db8cc8dec6f37d527ec6b0f0d2fa4a1dd62b4fd Mon Sep 17 00:00:00 2001 From: sstevens-11 <123662148+sstevens-11@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:36:11 -0500 Subject: [PATCH 1/4] Create ci.yml Add GitHub Actions workflow ci.yml file --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8579277b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test From e7cb9f30c8e650ff32d5a532e14eff87cdf87909 Mon Sep 17 00:00:00 2001 From: sstevens-11 <123662148+sstevens-11@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:41:10 -0500 Subject: [PATCH 2/4] Update ci.yml Updated workflow to what was in the directions. --- .github/workflows/ci.yml | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8579277b..3623ba6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,28 +1,19 @@ -name: CI +name: 'Run App Shelby Stevens' -on: - push: - branches: - - main - pull_request: - branches: - - main +on: [push, pull_request] jobs: - build: + check-bats-version: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Install dependencies - run: npm install - - - name: Run tests - run: npm test + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '5.0.301' + - uses: nuget/setup-nuget@v1 + - name: Nuget Restore + run: nuget restore GithubActions.sln + - name: Install dependencies + run: dotnet restore GithubActions.sln + - name: Build + run: msbuild /p:Configuration=Release GithubActions.sln From 3fe71f11ec50bb00177f20e3ef34158a328b18b6 Mon Sep 17 00:00:00 2001 From: sstevens-11 Date: Thu, 7 Nov 2024 18:49:50 -0600 Subject: [PATCH 3/4] implement power method --- Console/Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Console/Program.cs b/Console/Program.cs index 9be02228..9895c9d8 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -84,7 +84,13 @@ public static double Divide(string x, string y) // Implement this method following a similar pattern as above public static double Power(string x, string y) { - throw new NotImplementedException(); + double pow = 1; + + for ( int i = 0; i < y; i++) + { + pow = pow * x; + } + return pow; } } From 0bf5aa98b06dbb8f71d23c7a0de00425256a75db Mon Sep 17 00:00:00 2001 From: sstevens-11 Date: Thu, 7 Nov 2024 19:15:39 -0600 Subject: [PATCH 4/4] implemented power method --- Console/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Console/Program.cs b/Console/Program.cs index 9895c9d8..88720930 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -86,9 +86,9 @@ public static double Power(string x, string y) { double pow = 1; - for ( int i = 0; i < y; i++) + for ( int i = 0; i < double.Parse(y); i++) { - pow = pow * x; + pow = pow * double.Parse(x); } return pow; }