From 5d92da8d596fd080e668f6a24d45a6a9434f2f61 Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Sun, 15 Feb 2026 19:09:00 -0600 Subject: [PATCH 1/8] First program. --- labs/lab_1/lab_1a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index 9d15ec83..90dce086 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -8,7 +8,7 @@ def main(): print("Hello World!") - name = "" # TODO: Insert your name between the double quotes + name = "Aayan Majid" # TODO: Insert your name between the double quotes print(f"{name}, Welcome to the CSS course!") From 752c46240de8ab3b84f8b8e67e1c7801c66f6f1a Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Sun, 15 Feb 2026 19:57:32 -0600 Subject: [PATCH 2/8] Define robot speed variable in lab_1a.py Added a variable for robot speed in lab_1a.py --- labs/lab_1/lab_1a.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index 90dce086..fbacb0a5 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -1,6 +1,8 @@ """ lab_1a.py +robot speed = 5 #m/s + The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 with your name. Then, save the code, add it to the staging area, and commit it to the Git tree. """ From f64b88ef6032de4a6765bf12d6ba40030de26533 Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Mon, 16 Feb 2026 12:12:15 -0600 Subject: [PATCH 3/8] Change robot speed from 5 to 3 m/s --- labs/lab_1/lab_1a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index fbacb0a5..e01dfd9b 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -1,7 +1,7 @@ """ lab_1a.py -robot speed = 5 #m/s +robot speed = 3 #m/s The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 with your name. Then, save the code, add it to the staging area, and commit it to the Git tree. From d830c63bc3e52e4ebe6cb26c597d927452ba3b10 Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Mon, 16 Feb 2026 12:14:06 -0600 Subject: [PATCH 4/8] changed speed from 5 to 8 --- labs/lab_1/lab_1a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index fbacb0a5..6ab3f24e 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -1,7 +1,7 @@ """ lab_1a.py -robot speed = 5 #m/s +robot speed = 8 #m/s The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 with your name. Then, save the code, add it to the staging area, and commit it to the Git tree. From d3297fe575faae87496eefe505cc0785fb2e9066 Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Mon, 16 Feb 2026 13:07:48 -0600 Subject: [PATCH 5/8] sanitized numbers --- labs/lab_1/lab_1b.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/labs/lab_1/lab_1b.py b/labs/lab_1/lab_1b.py index e58dd957..e3542193 100644 --- a/labs/lab_1/lab_1b.py +++ b/labs/lab_1/lab_1b.py @@ -36,6 +36,15 @@ def simple_calculator(operation: str, num1: float, num2: float) -> float: raise ValueError("Cannot divide by zero.") else: raise ValueError("Invalid operation. Please choose from 'add', 'subtract', 'multiply', or 'divide'.") + +def sanitized_num(prompt str) -> float: + + try: + number = float(input(prompt)) + return number + + except ValueError: + print("invalid num, try again.") def main(): From d3d99f2d984d32633f9f748f00825d162e52c638 Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Sun, 22 Feb 2026 12:11:08 -0600 Subject: [PATCH 6/8] fixed syntax error in lab_1b.py --- labs/lab_1/lab_1b.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1b.py b/labs/lab_1/lab_1b.py index e3542193..70f6037b 100644 --- a/labs/lab_1/lab_1b.py +++ b/labs/lab_1/lab_1b.py @@ -37,7 +37,7 @@ def simple_calculator(operation: str, num1: float, num2: float) -> float: else: raise ValueError("Invalid operation. Please choose from 'add', 'subtract', 'multiply', or 'divide'.") -def sanitized_num(prompt str) -> float: +def sanitized_num(prompt: str) -> float: try: number = float(input(prompt)) From 3e102de365d87c27b7e2bdf65a552faa1c56b584 Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Sun, 22 Feb 2026 12:11:57 -0600 Subject: [PATCH 7/8] fixed the bug in lab_1b.py --- labs/lab_1/lab_1b.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1b.py b/labs/lab_1/lab_1b.py index e3542193..70f6037b 100644 --- a/labs/lab_1/lab_1b.py +++ b/labs/lab_1/lab_1b.py @@ -37,7 +37,7 @@ def simple_calculator(operation: str, num1: float, num2: float) -> float: else: raise ValueError("Invalid operation. Please choose from 'add', 'subtract', 'multiply', or 'divide'.") -def sanitized_num(prompt str) -> float: +def sanitized_num(prompt: str) -> float: try: number = float(input(prompt)) From d8ad5ed9cd3bdb15a13506a9cdd0979ac0acf68b Mon Sep 17 00:00:00 2001 From: Aayan Majid Date: Sun, 22 Feb 2026 12:30:49 -0600 Subject: [PATCH 8/8] More tests added for lab 1b. --- .github/workflows/run_test.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/run_test.yml diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml new file mode 100644 index 00000000..c45bcbfc --- /dev/null +++ b/.github/workflows/run_test.yml @@ -0,0 +1,32 @@ +name: simple_calculator unit test + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with Ruff + run: | + pip install ruff + ruff --format=github --target-version=py310 . + continue-on-error: true + - name: Test with pytest + run: | + coverage run -m pytest tests/tests_1b.py -v -s + - name: Generate Coverage Report + run: | + coverage report -m \ No newline at end of file