Skip to content

Commit

Permalink
variableskak
Browse files Browse the repository at this point in the history
  • Loading branch information
Lara3333 committed Oct 31, 2024
1 parent 242d5e9 commit 799cbfd
Show file tree
Hide file tree
Showing 4 changed files with 779 additions and 37 deletions.
55 changes: 18 additions & 37 deletions _notebooks/CSSE/Sprint_3/2024-09-26-big-idea-3-7-2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"description: Nested conditionals in JavaScript allow for more complex decision-making by placing one conditional statement inside another. This structure enables a program to check additional conditions only if the previous condition is true, creating a layered decision process. In this lesson, students will learn how to implement nested if, else if, and else statements to create more specific control flows in their programs. Through examples and exercises, they will gain a deeper understanding of how to manage multiple conditions effectively, enhancing the logic of their code.\n",
"permalink: /csp/big-idea/p4/3-7-2\n",
"type: ccc\n",
"author: Risha Guha, Vibha Mandayam, Ava Shalon\n",
"author: Lara Banjac\n",
"---"
]
},
Expand Down Expand Up @@ -69,55 +69,36 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 53,
"metadata": {
"vscode": {
"languageId": "javascript"
}
},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (3745248713.py, line 1)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn[13], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m const outputDiv = document.getElementById(\"output\") || document.createElement(\"div\");\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
"data": {
"text/html": [
"\n",
"<div id=\"outputDiv\" style=\"margin-bottom: 10px;\"></div>\n",
"<input type=\"text\" id=\"userInput\" placeholder=\"Type 'enter' or 'leave'\">\n",
"<button id=\"submitButton\">Submit</button>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"\n",
"<div id=\"output\"></div>\n",
"\n",
"let weather = \"sunny\";\n",
"let transportation = \"available\";\n",
"let boots = \"not present\";\n",
"\n",
"console.log(\"The weather is \" + weather);\n",
"console.log(\"Your transportation is \" + transportation);\n",
"console.log(\"Your boots are \" + boots);\n",
"\n",
"if (weather === \"sunny\") {\n",
" if (transportation === \"available\") {\n",
" if (boots === \"present\") {\n",
" output.textcontext(\"You are ready to go hiking!\");\n",
" } else {\n",
" console.log(\"You need to find your boots first.\");\n",
" }\n",
" } else {\n",
" console.log(\"You need to arrange transportation.\");\n",
" }\n",
"} else {\n",
" console.log(\"It's not good weather for hiking.\");\n",
"}"
]
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3><span style=\"font-family: Ariel; color:#94c4ff\">Popcorn Hack 1</span></h3>\n",
"<h3><span style=\"font-family: Ariel; color:#80deea\">Popcorn Hack 1</span></h3>\n",
"\n",
"Try adding an additional condition for hiking (like location_determined or miles_in_the_hike)."
]
Expand All @@ -126,7 +107,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2><span style=\"font-family: Ariel; color:#94c4ff\">Example 2 - Booleans</span></h2>\n",
"<h2><span style=\"font-family: Ariel; color:#80deea\">Example 2 - Booleans</span></h2>\n",
"\n",
"1. Write a code that checks if you can host movie night.\n",
"2. Use the presence of a living room, a projector, and snacks to determine if movie night is possible\n",
Expand Down
Loading

0 comments on commit 799cbfd

Please sign in to comment.