diff --git a/_config.yml b/_config.yml
index 5815247..242a784 100644
--- a/_config.yml
+++ b/_config.yml
@@ -7,9 +7,7 @@ baseurl: "/JN-CSAblog"
remote_theme: jekyll/minima
minima:
social_links:
- - { platform: github, user_url: "https://github.com/nighthawkcoders"}
- - { platform: github, user_url: "https://github.com/Tirth-Thakkar"}
- - { platform: github, user_url: "https://github.com/h4seeb-cmd"}
+ - { platform: github, user_url: "https://github.com/Jyustin/JN-CSAblog"}
# remote_theme: pages-themes/dinky@v0.2.0
# remote_theme: pages-themes/minimal@v0.2.0
# remote_theme: pages-themes/hacker@v0.2.0
diff --git a/_notebooks/2023-08-17-AP-pseudo-vs-python.ipynb b/_notebooks/2023-08-17-AP-pseudo-vs-python.ipynb
deleted file mode 100644
index d6efdb7..0000000
--- a/_notebooks/2023-08-17-AP-pseudo-vs-python.ipynb
+++ /dev/null
@@ -1,127 +0,0 @@
-{
- "cells": [
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "---\n",
- "toc: true\n",
- "comments: true\n",
- "layout: notebook\n",
- "title: College Board Pseudo Code \n",
- "description: The College Board testing language is Pseudo Code. Pseudo mean kind-of language that we will compare to Python.\n",
- "courses: { csp: {week: 1} }\n",
- "type: hacks\n",
- "---"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Learning College Board Pseudo Code\n",
- "> College Board uses a kind-of programming language in its Multiple Choice exam. There are thousands of different programming languages have been created, and more are being created every year. College Board has designed a pseudo code, a non operational programming language, to highlight concepts that it wants every student to learn.\n",
- "\n",
- "College Board is trying to remain neutral and build Computer Science Principles off of any language, thus the Teacher is left to pick the language(s) according to application and curriculum. \n",
- "\n",
- "College Board Pseudo Code [Exam Reference Sheet](https://apcentral.collegeboard.org/media/pdf/ap-computer-science-principles-exam-reference-sheet.pdf)\n"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Comparison of CB Pseudo Code to Python with descriptions\n",
- "\n",
- "Command Vocabulary | Pseudo code | Python | Purpose\n",
- "Output | DISPLAY(expression) | print(expression, end=\" \") | Displays the value of expression, followed by a space. Python defaults to newline, thus the end=\" \"\n",
- "Input | a ← INPUT() | a = input(prompt) | Accepts a value from the user and returns it to the variable a.\n",
- "Assignment |\ta ← expression\t | a = expression | Evaluates expression and assigns the result to the variable a.\n",
- "Selection | IF (expression) | if expression: | Run commands in the code block associated with the selection\n",
- "Iteration n times |\tREPEAT n TIMES | for i in range(n): | Repeat commands in the code block associated withe the iteration n times\n",
- "Iteration expression | REPEAT UNTIL (expression) |\twhile expression: | Repeat commands in the code block associated withe the iteration while expression is true\n",
- "List Assignment | list ← [expression1, expression2, expression3] | list = [expression1, expression2, expression3] | Assigns 3 values to list, value can be literal or expressions\n",
- "First index in List |\tlist[1] | list[0] | Access the 1st element in the list[]. FYI, most programming languages start a zero.\n",
- "Last index in List | list[LENGTH(list)] | list[len(list) - 1] | Access the last element in the list[]. If you start at zero, last element is length - 1.\n",
- "Define Procedure | PROCEDURE name (parameter) | def name(parameter): | Create a procedure containing a sequence of programming instructions.\n",
- "Expression equals |\ta = b\t| a == b | Evaluate if assigned value of a equals assigned value of b\n",
- "Expression not equals |\ta ≠ b\t| a != b | Evaluate if assigned value of a is NOT equal to assigned value of b"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Pseudo code IF Code Block\n",
- "```\n",
- "a ← 1\n",
- "b ← 1\n",
- "\n",
- "IF (a = b) {\n",
- " DISPLAY(\"A equals B\")\n",
- "}\n",
- "```"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Python code if block to match Pseudo Code\n",
- "a = 1\n",
- "b = 1\n",
- "if (a == b):\n",
- " # Python uses indent to establish code block, Teacher use tab key\n",
- " print(\"A equals B\")"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Hacks\n",
- "> Key Learnings. It is very important that you become fluent in \" Vocabulary\" and researching problems.\n",
- "\n",
- "- Code a JavaScript cell, this must start with %%js%% in first line of cell. Match the IF condition example in this blog.\n",
- "\n",
- "- Code a REPEAT n TIMES as described in comparison sheet in Pseudo code, Python, and JavaScript. Be sure to comment your code.\n",
- " - REPEAT 100 TIMES\n",
- " - Sum all the numpers\n",
- " - PRINT the result\n",
- "\n",
- "- Reflect on our PSEUDO code and how it helped with your problem solving in these hacks. \n",
- "\n",
- "- Maked efinition for: code block, sequence, selections, iteration. Consider a strategy to remember Pseudo Code, Python and JavaScript for these definitions."
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "base",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.9.12"
- },
- "orig_nbformat": 4
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/_notebooks/2023-08-17-Markdown_Table_Code_Hack.ipynb b/_notebooks/2023-08-17-Markdown_Table_Code_Hack.ipynb
deleted file mode 100644
index a1c0da6..0000000
--- a/_notebooks/2023-08-17-Markdown_Table_Code_Hack.ipynb
+++ /dev/null
@@ -1,141 +0,0 @@
-{
- "cells": [
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "---\n",
- "toc: true\n",
- "comments: true\n",
- "layout: notebook\n",
- "title: IPYNB Table, Code\n",
- "description: Example!!! This sample shows markdown cell, markdown table, markdown code fencing, and code cells.\n",
- "courses: { compsci: {week: 1} }\n",
- "type: hacks\n",
- "---"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Learning College Board Pseudo Code\n",
- "> College Board uses a kind-of programming language in its Multiple Choice exam. There are thousands of different programming languages have been created, and more are being created every year. College Board has designed a pseudo code, a non operational programming language, to highlight concepts that it wants every student to learn.\n",
- "\n",
- "College Board is trying to remain neutral and build Computer Science Principles off of any language, thus the Teacher is left to pick the language(s) according to application and curriculum. \n",
- "\n",
- "College Board Pseudo Code [Exam Reference Sheet](https://apcentral.collegeboard.org/media/pdf/ap-computer-science-principles-exam-reference-sheet.pdf)\n"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Comparison of CB Pseudo Code to Python with descriptions\n",
- "\n",
- "Command Vocabulary | Pseudo code | Python | Purpose\n",
- "Output | DISPLAY(expression) | print(expression, end=\" \") | Displays the value of expression, followed by a space. Python defaults to newline, thus the end=\" \"\n",
- "Input | a ← INPUT() | a = input(prompt) | Accepts a value from the user and returns it to the variable a.\n",
- "Assignment |\ta ← expression\t | a = expression | Evaluates expression and assigns the result to the variable a.\n",
- "Selection | IF (expression) | if expression: | Run commands in the code block associated with the selection\n",
- "Iteration n times |\tREPEAT n TIMES | for i in range(n): | Repeat commands in the code block associated withe the iteration n times\n",
- "Iteration expression | REPEAT UNTIL (expression) |\twhile expression: | Repeat commands in the code block associated withe the iteration while expression is true\n",
- "List Assignment | list ← [expression1, expression2, expression3] | list = [expression1, expression2, expression3] | Assigns 3 values to list, value can be literal or expressions\n",
- "First index in List |\tlist[1] | list[0] | Access the 1st element in the list[]. FYI, most programming languages start a zero.\n",
- "Last index in List | list[LENGTH(list)] | list[len(list) - 1] | Access the last element in the list[]. If you start at zero, last element is length - 1.\n",
- "Define Procedure | PROCEDURE name (parameter) | def name(parameter): | Create a procedure containing a sequence of programming instructions.\n",
- "Expression equals |\ta = b\t| a == b | Evaluate if assigned value of a equals assigned value of b\n",
- "Expression not equals |\ta ≠ b\t| a != b | Evaluate if assigned value of a is NOT equal to assigned value of b"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Pseudo code IF Code Block\n",
- "```\n",
- "a ← 1\n",
- "b ← 1\n",
- "\n",
- "IF (a = b) {\n",
- " DISPLAY(\"A equals B\")\n",
- "}\n",
- "```"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "A equals B\n"
- ]
- }
- ],
- "source": [
- "# Python code if block to match Pseudo Code\n",
- "a = 1\n",
- "b = 1\n",
- "if (a == b):\n",
- " # Python uses indent to establish code block, Teacher use tab key\n",
- " print(\"A equals B\")"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Hacks\n",
- "> Key Learnings. It is very important that you become fluent in \" Vocabulary\" and researching problems.\n",
- "\n",
- "- Code a JavaScript cell, this must start with %%js%% in first line of cell. Match the IF condition example in this blog.\n",
- "\n",
- "- Code a REPEAT n TIMES as described in comparison sheet in Pseudo code, Python, and JavaScript. Be sure to comment your code.\n",
- " - REPEAT 100 TIMES\n",
- " - Sum all the numpers\n",
- " - PRINT the result\n",
- "\n",
- "- Reflect on our PSEUDO code and how it helped with your problem solving in these hacks. \n",
- "\n",
- "- Maked efinition for: code block, sequence, selections, iteration. Consider a strategy to remember Pseudo Code, Python and JavaScript for these definitions."
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "base",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.9.12"
- },
- "orig_nbformat": 4
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/_notebooks/2023-08-21-HTML_Image_Hack.ipynb b/_notebooks/2023-08-21-HTML_Image_Hack.ipynb
deleted file mode 100644
index ed105c7..0000000
--- a/_notebooks/2023-08-21-HTML_Image_Hack.ipynb
+++ /dev/null
@@ -1,209 +0,0 @@
-{
- "cells": [
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "---\n",
- "comments: true\n",
- "layout: notebook\n",
- "title: IPYNB HTML, img\n",
- "description: A key to development in this class is the association VSCode to a GitHub pages project. This is where students update assignments and present work.\n",
- "type: hacks\n",
- "courses: { compsci: {week: 0} }\n",
- "categories: [C4.1]\n",
- "---"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Create your own GitHub Pages Project\n",
- "> Make you own project from GitHub Pages Student Repo."
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Make a GitHub Pages Repository\n",
- "> Goto GitHub [student](https://github.com/nighthawkcoders/student).\n",
- "\n",
- "- Reference: [Create from template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). Most student will pick this option.\n",
- "\n",
- "\n",
- "- Reference: [Fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). Student in CSA that teacher has asked to contribute to student example repo will pick this.\n"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Start the GitHub Pages Student Project\n",
- "> Run the following commands using terminal on you machine. Be sure Repo has been forked.\n",
- "\n",
- "- Clone and Open project in VSCode\n",
- "- Change \"forkme\" text with your \"ghid\" or selected location\n",
- "\n",
- "\n",
- "```bash\n",
- "(base) id:~$ mkdir vscode # make a vscode directory, if you don't have one\n",
- "(base) id:~$ cd vscode # change to the directory\n",
- "(base) id:~$ git clone https://github.com/forkme/student.git # change to your repo\n",
- "(base) id:~$ cd student # change to the project directory\n",
- "(base) id:~$ code . # open VSCode in project directory\n",
- "```"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### VSCode for Python Extensions, adapt for your needs JavaScript, Python, Java\n",
- "- VSCode [Language extensions](https://code.visualstudio.com/docs/languages/overview)\n",
- " - Install Python, Python Environment Manager, Python Extension Pack, Pylance\n",
- " - Install Jupyter, Jupyter Keymap\n",
- " - Install IntelliCode, IntelliCode API Usage Examples\n",
- " - Windows machines install WSL Remote Development"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {
- "vscode": {
- "languageId": "html"
- }
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "\n",
- "
\n",
- " Visual Studio Code claims to provide just the tools a developer needs for a quick code-build-debug and version control cycle. It provides a Market Place for enhancements and more complex workflows. Before adding extensions, clone projects and see what is requested or added. Here are some extension that were added through that process or that I have added...\n",
- "
\n",
- "
\n",
- "
\n",
- " In marketplace there are several extensions for Python, Python Intellisense, Python Extension Pack\n",
- "
\n",
- "
\n",
- " Jupyter: This supports build jupyter ipynb files from within VS Code\n",
- "
\n",
- "
\n",
- " Code Spell Checker: Got to have it when building documents, particularly if you spell and typo like the Teacher\n",
- "
\n",
- "
\n",
- " IntelliCode: Got to have it when creating a code file, it will sense type of code by extension. Also, it help with syntax as you are coding.\n",
- "
\n",
- "
\n",
- "
\n",
- " Review Details in Marketplace for better explanation of purpose of the things explained above. There is a lot more! As you need Git help look at things like Git History and GitLens. Or, perhaps you enjoy Vim and want Vim emulation for editing, their is an extension for that. Later, there may be interest in AWS Toolkit or Deploy extensions. We will learn more about Marketplace Extensions as we do more.\n",
- "
\n",
- " Visual Studio Code claims to provide just the tools a developer needs for a quick code-build-debug and version control cycle. It provides a Market Place for enhancements and more complex workflows. Before adding extensions, clone projects and see what is requested or added. Here are some extension that were added through that process or that I have added...\n",
- "
\n",
- "
\n",
- "
\n",
- " In marketplace there are several extensions for Python, Python Intellisense, Python Extension Pack\n",
- "
\n",
- "
\n",
- " Jupyter: This supports build jupyter ipynb files from within VS Code\n",
- "
\n",
- "
\n",
- " Code Spell Checker: Got to have it when building documents, particularly if you spell and typo like the Teacher\n",
- "
\n",
- "
\n",
- " IntelliCode: Got to have it when creating a code file, it will sense type of code by extension. Also, it help with syntax as you are coding.\n",
- "
\n",
- "
\n",
- "
\n",
- " Review Details in Marketplace for better explanation of purpose of the things explained above. There is a lot more! As you need Git help look at things like Git History and GitLens. Or, perhaps you enjoy Vim and want Vim emulation for editing, their is an extension for that. Later, there may be interest in AWS Toolkit or Deploy extensions. We will learn more about Marketplace Extensions as we do more.\n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Hacks\n",
- "> Setup Tools and test GitHub connection. Tool and Equipment setup is like attendance, without Tools and Equipment you are effectually absent.\n",
- "- Change index.md to show it is REALLY YOURS. Refer to [Markdown Cheet Sheet](https://www.markdownguide.org/cheat-sheet/).\n",
- " - Push a minor \"index.md\" change and Verify on GitHub [https://code.visualstudio.com/docs/editor/versioncontrol#_git-support](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)\n",
- " - Verify \"index.md\" change on deployed GitHub Pages"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3 (ipykernel)",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.9.12"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/_notebooks/2023-08-21-VSCode-GitHub_Pages.ipynb b/_notebooks/2023-08-21-VSCode-GitHub_Pages.ipynb
deleted file mode 100644
index cd92a08..0000000
--- a/_notebooks/2023-08-21-VSCode-GitHub_Pages.ipynb
+++ /dev/null
@@ -1,210 +0,0 @@
-{
- "cells": [
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "---\n",
- "comments: true\n",
- "layout: notebook\n",
- "title: Student GitHub Pages\n",
- "description: A key to development in this class is the association VSCode to a GitHub pages project. This is where students update assignments and present work.\n",
- "type: hacks\n",
- "toc: true\n",
- "courses: { csse: {week: 0}, csp: {week: 0}, csa: {week: 0} }\n",
- "categories: [C4.1]\n",
- "---"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Create your own GitHub Pages Project\n",
- "> Make you own project from GitHub Pages Student Repo."
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Make a GitHub Pages Repository\n",
- "> Goto GitHub [student](https://github.com/nighthawkcoders/student).\n",
- "\n",
- "- Reference: [Create from template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). Most student will pick this option.\n",
- "\n",
- "\n",
- "- Reference: [Fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). Student in CSA that teacher has asked to contribute to student example repo will pick this.\n"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Start the GitHub Pages Student Project\n",
- "> Run the following commands using terminal on you machine. Be sure Repo has been forked.\n",
- "\n",
- "- Clone and Open project in VSCode\n",
- "- Change \"forkme\" text with your \"ghid\" or selected location\n",
- "\n",
- "\n",
- "```bash\n",
- "(base) id:~$ mkdir vscode # make a vscode directory, if you don't have one\n",
- "(base) id:~$ cd vscode # change to the directory\n",
- "(base) id:~$ git clone https://github.com/forkme/student.git # change to your repo\n",
- "(base) id:~$ cd student # change to the project directory\n",
- "(base) id:~$ code . # open VSCode in project directory\n",
- "```"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### VSCode for Python Extensions, adapt for your needs JavaScript, Python, Java\n",
- "- VSCode [Language extensions](https://code.visualstudio.com/docs/languages/overview)\n",
- " - Install Python, Python Environment Manager, Python Extension Pack, Pylance\n",
- " - Install Jupyter, Jupyter Keymap\n",
- " - Install IntelliCode, IntelliCode API Usage Examples\n",
- " - Windows machines install WSL Remote Development"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {
- "vscode": {
- "languageId": "html"
- }
- },
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "\n",
- "
\n",
- " Visual Studio Code claims to provide just the tools a developer needs for a quick code-build-debug and version control cycle. It provides a Market Place for enhancements and more complex workflows. Before adding extensions, clone projects and see what is requested or added. Here are some extension that were added through that process or that I have added...\n",
- "
\n",
- "
\n",
- "
\n",
- " In marketplace there are several extensions for Python, Python Intellisense, Python Extension Pack\n",
- "
\n",
- "
\n",
- " Jupyter: This supports build jupyter ipynb files from within VS Code\n",
- "
\n",
- "
\n",
- " Code Spell Checker: Got to have it when building documents, particularly if you spell and typo like the Teacher\n",
- "
\n",
- "
\n",
- " IntelliCode: Got to have it when creating a code file, it will sense type of code by extension. Also, it help with syntax as you are coding.\n",
- "
\n",
- "
\n",
- "
\n",
- " Review Details in Marketplace for better explanation of purpose of the things explained above. There is a lot more! As you need Git help look at things like Git History and GitLens. Or, perhaps you enjoy Vim and want Vim emulation for editing, their is an extension for that. Later, there may be interest in AWS Toolkit or Deploy extensions. We will learn more about Marketplace Extensions as we do more.\n",
- "
\n",
- " Visual Studio Code claims to provide just the tools a developer needs for a quick code-build-debug and version control cycle. It provides a Market Place for enhancements and more complex workflows. Before adding extensions, clone projects and see what is requested or added. Here are some extension that were added through that process or that I have added...\n",
- "
\n",
- "
\n",
- "
\n",
- " In marketplace there are several extensions for Python, Python Intellisense, Python Extension Pack\n",
- "
\n",
- "
\n",
- " Jupyter: This supports build jupyter ipynb files from within VS Code\n",
- "
\n",
- "
\n",
- " Code Spell Checker: Got to have it when building documents, particularly if you spell and typo like the Teacher\n",
- "
\n",
- "
\n",
- " IntelliCode: Got to have it when creating a code file, it will sense type of code by extension. Also, it help with syntax as you are coding.\n",
- "
\n",
- "
\n",
- "
\n",
- " Review Details in Marketplace for better explanation of purpose of the things explained above. There is a lot more! As you need Git help look at things like Git History and GitLens. Or, perhaps you enjoy Vim and want Vim emulation for editing, their is an extension for that. Later, there may be interest in AWS Toolkit or Deploy extensions. We will learn more about Marketplace Extensions as we do more.\n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Hacks\n",
- "> Setup Tools and test GitHub connection. Tool and Equipment setup is like attendance, without Tools and Equipment you are effectually absent.\n",
- "- Change index.md to show it is REALLY YOURS. Refer to [Markdown Cheet Sheet](https://www.markdownguide.org/cheat-sheet/).\n",
- " - Push a minor \"index.md\" change and Verify on GitHub [https://code.visualstudio.com/docs/editor/versioncontrol#_git-support](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)\n",
- " - Verify \"index.md\" change on deployed GitHub Pages"
- ]
- },
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3 (ipykernel)",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.9.12"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/_notebooks/2023-09-23-unit2hacks.ipynb b/_notebooks/2023-09-23-unit2hacks.ipynb
new file mode 100755
index 0000000..4079dfb
--- /dev/null
+++ b/_notebooks/2023-09-23-unit2hacks.ipynb
@@ -0,0 +1,605 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "---\n",
+ "layout: post\n",
+ "title: Unit 2 Hacks\n",
+ "description: hacks and tricks learned in Unit 2 of Computer Science A\n",
+ "type: tangibles\n",
+ "courses: { compsci: {week: 0} }\n",
+ "categories: [C4.1]\n",
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# note: the following hacks were done with chatgpt assist. I don't claim to have written every line of code here\n",
+ "\n",
+ "# Hack 1: \n",
+ "\n",
+ "Create a void method that takes an integer input and adds it to an ArrayList. Then, add a non-void method that is able to call a certain index from the ArrayList."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter an integer: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ArrayList contents: [5, 3]\n",
+ "Element at index 1: 3\n"
+ ]
+ }
+ ],
+ "source": [
+ "import java.util.ArrayList;\n",
+ "import java.util.Scanner;\n",
+ "\n",
+ "public class ArrayListTest {\n",
+ "\n",
+ " // Declare ArrayList as a static field to make it accessible across methods\n",
+ " private static ArrayList numbers = new ArrayList();\n",
+ "\n",
+ " public static void inputArrlist() {\n",
+ " Scanner sc = new Scanner(System.in);\n",
+ " System.out.print(\"Enter an integer: \");\n",
+ " int n = sc.nextInt(); // take input from user\n",
+ " numbers.add(n); // add input to ArrayList\n",
+ " }\n",
+ "\n",
+ " // A non-void method to get an element from ArrayList by index\n",
+ " public static int getElementAtIndex(int index) {\n",
+ " if (index >= 0 && index < numbers.size()) {\n",
+ " return numbers.get(index);\n",
+ " } else {\n",
+ " System.out.println(\"Index out of bounds.\");\n",
+ " return -1; // You can choose a different return value or throw an exception if needed\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Java standard runtime entry point\n",
+ " public static void main(String[] args) {\n",
+ " inputArrlist(); // Call the method to add an integer to the ArrayList\n",
+ "\n",
+ " // Print the ArrayList\n",
+ " System.out.println(\"ArrayList contents: \" + numbers);\n",
+ "\n",
+ " // Example of calling the non-void method to get an element by index\n",
+ " int indexToAccess = 1; // Change this to the desired index\n",
+ " int elementAtIndex = getElementAtIndex(indexToAccess);\n",
+ "\n",
+ " if (elementAtIndex != -1) {\n",
+ " System.out.println(\"Element at index \" + indexToAccess + \": \" + elementAtIndex);\n",
+ " }\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "ArrayListTest.main(null); // Class prefix allows reference of Static Method"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# HACK 2\n",
+ "Create a simple guessing game with random numbers in math, except the random number is taken to a random exponent (also includes roots), and the person has to find out what the root and exponent is (with hints!). Use at least one static and one non-static method in your class."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Welcome to the Exponent Guessing Game!\n",
+ "I've generated a random number, raised it to an exponent,\n",
+ "and your task is to guess both the base and the exponent.\n",
+ "Let's get started!\n",
+ "Enter your guess for the base: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter your guess for the exponent: Hint: The base is less than 3.\n",
+ "Hint: The exponent is 0.5 (a square root).\n",
+ "Enter your guess for the base: Enter your guess for the exponent: Hint: The base is less than 3.\n",
+ "Hint: The exponent is 0.5 (a square root).\n",
+ "Enter your guess for the base: Enter your guess for the exponent: Congratulations! You've guessed it!\n",
+ "It took you 3 attempts.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import java.util.Random;\n",
+ "import java.util.Scanner;\n",
+ "\n",
+ "public class ExponentGuessingGame {\n",
+ "\n",
+ " // Static field\n",
+ " private static Random random = new Random();\n",
+ " private double base;\n",
+ " private double exponent;\n",
+ "\n",
+ " // Constructor (non-static)\n",
+ " public ExponentGuessingGame() {\n",
+ " generateRandomNumber(); // Initialize the game by generating a random base and exponent.\n",
+ " }\n",
+ "\n",
+ " // Non-static method\n",
+ " private void generateRandomNumber() {\n",
+ " base = random.nextInt(2); // Generate a random base between 1 and 2.\n",
+ " int exponentChoice = random.nextInt(3); // Choose a random exponent type (0: Square root, 1: Cube root, 2: Random exponent).\n",
+ " if (exponentChoice == 0) {\n",
+ " exponent = 0.5; // Set the exponent to 0.5 for a square root.\n",
+ " } else if (exponentChoice == 1) {\n",
+ " exponent = 1.0 / 3.0; // Set the exponent to 1/3 for a cube root.\n",
+ " } else {\n",
+ " exponent = 2; // Set the exponent to 2 for square.\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Non-static method\n",
+ " public void play() {\n",
+ " Scanner scanner = new Scanner(System.in);\n",
+ " int attempts = 0;\n",
+ "\n",
+ " System.out.println(\"Welcome to the Exponent Guessing Game!\");\n",
+ " System.out.println(\"I've generated a random number, raised it to an exponent,\");\n",
+ " System.out.println(\"and your task is to guess both the base and the exponent.\");\n",
+ " System.out.println(\"Let's get started!\");\n",
+ "\n",
+ " while (true) {\n",
+ " attempts++;\n",
+ " System.out.print(\"Enter your guess for the base: \");\n",
+ " double guessedBase = scanner.nextDouble();\n",
+ " System.out.print(\"Enter your guess for the exponent: \");\n",
+ " double guessedExponent = scanner.nextDouble();\n",
+ "\n",
+ " if (guessedBase == base && guessedExponent == exponent) {\n",
+ " System.out.println(\"Congratulations! You've guessed it!\");\n",
+ " System.out.println(\"It took you \" + attempts + \" attempts.\");\n",
+ " break;\n",
+ " } else {\n",
+ " displayHint(base, exponent); // Non-static method call to provide hints.\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " scanner.close();\n",
+ " }\n",
+ "\n",
+ " // Static method\n",
+ " private static void displayHint(double base, double exponent) {\n",
+ " if (base < 3) {\n",
+ " System.out.println(\"Hint: The base is less than 3.\");\n",
+ " } else {\n",
+ " System.out.println(\"Hint: The base is greater than or equal to 3.\");\n",
+ " }\n",
+ "\n",
+ " if (exponent == 0.5) {\n",
+ " System.out.println(\"Hint: The exponent is 0.5 (a square root).\");\n",
+ " } else if (exponent == 0.3) {\n",
+ " System.out.println(\"Hint: The exponent is 0.3 (a cube root).\");\n",
+ " } else {\n",
+ " System.out.println(\"Hint: The exponent is 2.\");\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Static method (entry point of the program)\n",
+ " public static void main(String[] args) {\n",
+ " ExponentGuessingGame game = new ExponentGuessingGame();\n",
+ " game.play(); // Start the game by calling the play method (non-static).\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "ExponentGuessingGame.main(null);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# HACK 3\n",
+ "Create a class of your choosing that has multiple parameters of different types (int, boolean, String, double) and put 5 data values in that list. Show that you can access the information by givng some samples."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Person 1 - Name: John, Age: 25, Student: false, Height: 5.9\n",
+ "Person 2 - Name: Alice, Age: 18, Student: true, Height: 5.5\n",
+ "Person 3 - Name: Bob, Age: 30, Student: false, Height: 6.0\n",
+ "Person 4 - Name: Eve, Age: 22, Student: true, Height: 5.7\n",
+ "Person 5 - Name: Charlie, Age: 28, Student: false, Height: 6.2\n"
+ ]
+ }
+ ],
+ "source": [
+ "public class Person {\n",
+ " // Declare private instance variables for a Person\n",
+ " private int age;\n",
+ " private boolean isStudent;\n",
+ " private String name;\n",
+ " private double height;\n",
+ "\n",
+ " // Constructor to initialize a Person with provided data\n",
+ " public Person(int age, boolean isStudent, String name, double height) {\n",
+ " // Initialize the instance variables with the provided values\n",
+ " this.age = age;\n",
+ " this.isStudent = isStudent;\n",
+ " this.name = name;\n",
+ " this.height = height;\n",
+ " }\n",
+ "\n",
+ " // Getter method to retrieve the age of the Person\n",
+ " public int getAge() {\n",
+ " return age;\n",
+ " }\n",
+ "\n",
+ " // Getter method to check if the Person is a student\n",
+ " public boolean isStudent() {\n",
+ " return isStudent;\n",
+ " }\n",
+ "\n",
+ " // Getter method to retrieve the name of the Person\n",
+ " public String getName() {\n",
+ " return name;\n",
+ " }\n",
+ "\n",
+ " // Getter method to retrieve the height of the Person\n",
+ " public double getHeight() {\n",
+ " return height;\n",
+ " }\n",
+ "\n",
+ " public static void main(String[] args) {\n",
+ " // Create five Person instances with sample data\n",
+ " Person person1 = new Person(25, false, \"John\", 5.9);\n",
+ " Person person2 = new Person(18, true, \"Alice\", 5.5);\n",
+ " Person person3 = new Person(30, false, \"Bob\", 6.0);\n",
+ " Person person4 = new Person(22, true, \"Eve\", 5.7);\n",
+ " Person person5 = new Person(28, false, \"Charlie\", 6.2);\n",
+ "\n",
+ " // Access and print information from the Person instances\n",
+ " System.out.println(\"Person 1 - Name: \" + person1.getName() + \", Age: \" + person1.getAge() + \", Student: \" + person1.isStudent() + \", Height: \" + person1.getHeight());\n",
+ " System.out.println(\"Person 2 - Name: \" + person2.getName() + \", Age: \" + person2.getAge() + \", Student: \" + person2.isStudent() + \", Height: \" + person2.getHeight());\n",
+ " System.out.println(\"Person 3 - Name: \" + person3.getName() + \", Age: \" + person3.getAge() + \", Student: \" + person3.isStudent() + \", Height: \" + person3.getHeight());\n",
+ " System.out.println(\"Person 4 - Name: \" + person4.getName() + \", Age: \" + person4.getAge() + \", Student: \" + person4.isStudent() + \", Height: \" + person4.getHeight());\n",
+ " System.out.println(\"Person 5 - Name: \" + person5.getName() + \", Age: \" + person5.getAge() + \", Student: \" + person5.isStudent() + \", Height: \" + person5.getHeight());\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "Person.main(null);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# HACK 4\n",
+ "Using your preliminary knowlege of loops, use a for loop to iterate through a person’s first and last name, seperated by a space, and create methods to call a person’s first name and a person’s last name by iterating through the string."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "First Name: John\n",
+ "Last Name: Doe\n"
+ ]
+ }
+ ],
+ "source": [
+ "public class PersonName {\n",
+ " private String fullName;\n",
+ "\n",
+ " public PersonName(String fullName) {\n",
+ " this.fullName = fullName;\n",
+ " }\n",
+ "\n",
+ " // Method to get the first name\n",
+ " public String getFirstName() {\n",
+ " StringBuilder firstName = new StringBuilder();\n",
+ "\n",
+ " // Iterate through each character in the full name\n",
+ " for (int i = 0; i < fullName.length(); i++) {\n",
+ " char c = fullName.charAt(i);\n",
+ "\n",
+ " // Check if the current character is not a space\n",
+ " if (c != ' ') {\n",
+ " // Append the character to the first name\n",
+ " firstName.append(c);\n",
+ " } else {\n",
+ " // If a space is encountered, stop iterating (we've found the first name)\n",
+ " break;\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Convert the StringBuilder to a String and return the first name\n",
+ " return firstName.toString();\n",
+ " }\n",
+ "\n",
+ " // Method to get the last name\n",
+ " public String getLastName() {\n",
+ " StringBuilder lastName = new StringBuilder();\n",
+ " boolean foundSpace = false;\n",
+ "\n",
+ " // Iterate through each character in the full name in reverse order\n",
+ " for (int i = fullName.length() - 1; i >= 0; i--) {\n",
+ " char c = fullName.charAt(i);\n",
+ "\n",
+ " // Check if the current character is not a space and we haven't found a space yet\n",
+ " if (c != ' ' && !foundSpace) {\n",
+ " // Insert the character at the beginning of the last name (to reverse the order)\n",
+ " lastName.insert(0, c);\n",
+ " } else {\n",
+ " // If a space is encountered or we've already found a space, set the flag to true\n",
+ " foundSpace = true;\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Convert the StringBuilder to a String and return the last name\n",
+ " return lastName.toString();\n",
+ " }\n",
+ "\n",
+ " public static void main(String[] args) {\n",
+ " PersonName person = new PersonName(\"John Doe\");\n",
+ " \n",
+ " // Get and print the first name\n",
+ " String firstName = person.getFirstName();\n",
+ " System.out.println(\"First Name: \" + firstName);\n",
+ " \n",
+ " // Get and print the last name\n",
+ " String lastName = person.getLastName();\n",
+ " System.out.println(\"Last Name: \" + lastName);\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "\n",
+ "PersonName.main(null);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# HACK 4 BUT WITH USER INPUT FOR NAME"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter your full name: First Name: engineer\n",
+ "Last Name: gaming\n"
+ ]
+ }
+ ],
+ "source": [
+ "import java.util.Scanner;\n",
+ "\n",
+ "public class PersonName {\n",
+ " private String fullName;\n",
+ "\n",
+ " public PersonName(String fullName) {\n",
+ " this.fullName = fullName;\n",
+ " }\n",
+ "\n",
+ " // Method to get the first name\n",
+ " public String getFirstName() {\n",
+ " StringBuilder firstName = new StringBuilder();\n",
+ "\n",
+ " // Iterate through each character in the full name\n",
+ " for (int i = 0; i < fullName.length(); i++) {\n",
+ " char c = fullName.charAt(i);\n",
+ "\n",
+ " // Check if the current character is not a space\n",
+ " if (c != ' ') {\n",
+ " // Append the character to the first name\n",
+ " firstName.append(c);\n",
+ " } else {\n",
+ " // If a space is encountered, stop iterating (we've found the first name)\n",
+ " break;\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Convert the StringBuilder to a String and return the first name\n",
+ " return firstName.toString();\n",
+ " }\n",
+ "\n",
+ " // Method to get the last name\n",
+ " public String getLastName() {\n",
+ " StringBuilder lastName = new StringBuilder();\n",
+ " boolean foundSpace = false;\n",
+ "\n",
+ " // Iterate through each character in the full name in reverse order\n",
+ " for (int i = fullName.length() - 1; i >= 0; i--) {\n",
+ " char c = fullName.charAt(i);\n",
+ "\n",
+ " // Check if the current character is not a space and we haven't found a space yet\n",
+ " if (c != ' ' && !foundSpace) {\n",
+ " // Insert the character at the beginning of the last name (to reverse the order)\n",
+ " lastName.insert(0, c);\n",
+ " } else {\n",
+ " // If a space is encountered or we've already found a space, set the flag to true\n",
+ " foundSpace = true;\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Convert the StringBuilder to a String and return the last name\n",
+ " return lastName.toString();\n",
+ " }\n",
+ "\n",
+ " public static void main(String[] args) {\n",
+ " Scanner scanner = new Scanner(System.in);\n",
+ "\n",
+ " // Prompt the user for their full name\n",
+ " System.out.print(\"Enter your full name: \");\n",
+ " String fullName = scanner.nextLine();\n",
+ "\n",
+ " // Create a PersonName object with the user's input\n",
+ " PersonName person = new PersonName(fullName);\n",
+ "\n",
+ " // Get and print the first name\n",
+ " String firstName = person.getFirstName();\n",
+ " System.out.println(\"First Name: \" + firstName);\n",
+ "\n",
+ " // Get and print the last name\n",
+ " String lastName = person.getLastName();\n",
+ " System.out.println(\"Last Name: \" + lastName);\n",
+ "\n",
+ " // Close the scanner\n",
+ " scanner.close();\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "PersonName.main(null);"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "%maven org.knowm.xchart:xchart:3.5.2\n",
+ "\n",
+ "import org.knowm.xchart.*;\n",
+ "\n",
+ "public class HeartShapeGraph {\n",
+ "\n",
+ " public static void main(String[] args) throws Exception {\n",
+ " int numPoints = 100;\n",
+ " double[] xData = new double[numPoints];\n",
+ " double[] yData = new double[numPoints];\n",
+ "\n",
+ " plotHeartShape(xData, yData, 0, 0, numPoints - 1);\n",
+ "\n",
+ " // Create Chart\n",
+ " XYChart chart = QuickChart.getChart(\"Heart Shape\", \"X\", \"Y\", \"y(x)\", xData, yData);\n",
+ "\n",
+ " // Show it\n",
+ " new SwingWrapper(chart).displayChart();\n",
+ " }\n",
+ "\n",
+ " private static void plotHeartShape(double[] xData, double[] yData, int index, double t, int maxIndex) {\n",
+ " if (index > maxIndex) {\n",
+ " return;\n",
+ " }\n",
+ "\n",
+ " //Chat GPT Math\n",
+ " xData[index] = 16 * Math.pow(Math.sin(t), 3);\n",
+ " yData[index] = 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t);\n",
+ "\n",
+ " plotHeartShape(xData, yData, index + 1, t + (2 * Math.PI) / maxIndex, maxIndex);\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "HeartShapeGraph.main(null);"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[1;31mThe Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details."
+ ]
+ }
+ ],
+ "source": [
+ "%maven org.knowm.xchart:xchart:3.5.2\n",
+ "\n",
+ "import org.knowm.xchart.*;\n",
+ "\n",
+ "public class CoolGraph {\n",
+ "\n",
+ " public static void main(String[] args) throws Exception {\n",
+ " int numPoints = 100;\n",
+ " double[] xData = new double[numPoints];\n",
+ " double[] yData = new double[numPoints];\n",
+ "\n",
+ " plotHeartShape(xData, yData, 0, 0, numPoints - 1);\n",
+ "\n",
+ " // Create Chart\n",
+ " XYChart chart = QuickChart.getChart(\"Heart Shape\", \"X\", \"Y\", \"y(x)\", xData, yData);\n",
+ "\n",
+ " // Show it\n",
+ " new SwingWrapper(chart).displayChart();\n",
+ " }\n",
+ "\n",
+ " private static void plotHeartShape(double[] xData, double[] yData, int index, double t, int maxIndex) {\n",
+ " if (index > maxIndex) {\n",
+ " return;\n",
+ " }\n",
+ "\n",
+ " //Chat GPT Math\n",
+ " xData[index] = 16 * Math.pow(Math.cos(t), 3);\n",
+ " yData[index] = 13 * Math.sin(t) - 5 * Math.sin(2 * t) - 2 * Math.sin(3 * t) - Math.sin(4 * t);\n",
+ "\n",
+ " plotHeartShape(xData, yData, index + 1, t + (2 * Math.PI) / maxIndex, maxIndex);\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "HeartShapeGraph.main(null);"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Java",
+ "language": "java",
+ "name": "java"
+ },
+ "language_info": {
+ "codemirror_mode": "java",
+ "file_extension": ".jshell",
+ "mimetype": "text/x-java-source",
+ "name": "java",
+ "pygments_lexer": "java",
+ "version": "20.0.2+9"
+ },
+ "orig_nbformat": 4
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/_notebooks/2023-10-08-Unit_3_Booleans.ipynb b/_notebooks/2023-10-08-Unit_3_Booleans.ipynb
new file mode 100755
index 0000000..42263ec
--- /dev/null
+++ b/_notebooks/2023-10-08-Unit_3_Booleans.ipynb
@@ -0,0 +1,870 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "---\n",
+ "toc: true\n",
+ "comments: true\n",
+ "layout: post\n",
+ "title: Unit 3 Lesson\n",
+ "type: tangibles\n",
+ "courses: { compsci: {week: 0} }\n",
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Lessons\n",
+ "\n",
+ "## 3.1\n",
+ "\n",
+ "### Learning Objective\n",
+ "- Evaluate Boolean expressions that use relational operators in program code\n",
+ "\n",
+ "Types of Rational Operators\n",
+ "- Operators\n",
+ " - Primitives\n",
+ " - Equal to: ==\n",
+ " - Not Equal to: !=\n",
+ "- Arithmetic\n",
+ " - Greater than: >\n",
+ " - Less than: >\n",
+ " - Greater than or equal to: >=\n",
+ " - Less than or equal to: <=\n",
+ "\n",
+ "All operators give a `true` or `False` value\n",
+ "\n",
+ " Operators SHOULD NOT be used on String . String comparisons should be done using .equal or .compareTo\n",
+ "\n",
+ "- This is because\n",
+ " - In Java, strings should not be compared using the == operator because it checks for ______reference______ equality, not _______content_____ equality.\n",
+ " - When you use == with objects (including strings), it checks if the references to the objects are the same. In other words, it checks if they point to the same _______memory location_____ in the memory.\n",
+ " - String literals in Java are stored in a special memory area called the \"String Pool\". When you create a string literal, Java checks if a string with the same content already exists in the pool. If it does, it returns a reference to that existing string; if not, it creates a new string.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Comparing Numbers\n",
+ "\n",
+ "\n",
+ " \n",
+ "\n",
+ "\n",
+ "
\n",
+ " if (condition) {\n",
+ " // Code to execute if the condition is true\n",
+ " } else {\n",
+ " // Code to execute if the condition is false\n",
+ " }\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
else-if Syntax
\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ " if (condition1) {\n",
+ " // Code to be executed if condition1 is true\n",
+ " } else if (condition2) {\n",
+ " // Code to be executed if condition2 is true\n",
+ " } else if (condition3) {\n",
+ " // Code to be executed if condition3 is true\n",
+ " } else {\n",
+ " // Code to be executed if none of the conditions are true\n",
+ " }\n",
+ "