From 58512f69bb0e196d6c118d685210f227bf1e667f Mon Sep 17 00:00:00 2001 From: maradychor Date: Mon, 22 Jan 2024 17:37:59 -0800 Subject: [PATCH 1/5] done --- index.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 index.md diff --git a/index.md b/index.md new file mode 100644 index 0000000..272c213 --- /dev/null +++ b/index.md @@ -0,0 +1,50 @@ + + + + Welcome to Seattle! + + + +
+

+ Class Lab 1 +

+
+
+

+ Have you been to Pike Place Market? +

+
+ + + \ No newline at end of file From 4754c3a58db7f4d62c20ff51d68e68b4a6297804 Mon Sep 17 00:00:00 2001 From: maradychor Date: Mon, 22 Jan 2024 23:12:41 -0800 Subject: [PATCH 2/5] finalas --- README.md | 7 ---- class-01.md | 1 - index.html | 89 +++++++++++++++++++++++++++++++++++++++++++ index.md | 50 ------------------------ prompt-engineering.md | 6 --- 5 files changed, 89 insertions(+), 64 deletions(-) delete mode 100644 README.md delete mode 100644 class-01.md create mode 100644 index.html delete mode 100644 index.md delete mode 100644 prompt-engineering.md diff --git a/README.md b/README.md deleted file mode 100644 index 400b65b..0000000 --- a/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# readingnotes -Code 201 - Foundations of Software Development -## Welcome to my readingnotes! -Here will be all my notes, demos, and learning trials for _class201_ -I am so **excited** to be here! -We ~~NOT~~ give up in this class -***I can't wait tp learn!*** diff --git a/class-01.md b/class-01.md deleted file mode 100644 index 8b13789..0000000 --- a/class-01.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/index.html b/index.html new file mode 100644 index 0000000..4647060 --- /dev/null +++ b/index.html @@ -0,0 +1,89 @@ + + + + Welcome to Seattle! + + + +
+

+ Class Lab 1 +

+
+
+

+ Have you been to Pike Place Market? +

+

+ Have you heard of a city called Seattle? + +

+ +

+ Have you ever seen a fish get thrown across the room? + +

+ +

+ Would you be willing to travel to this wet city for some excitment?! + +

+
+ + +
+ +
+ + + \ No newline at end of file diff --git a/index.md b/index.md deleted file mode 100644 index 272c213..0000000 --- a/index.md +++ /dev/null @@ -1,50 +0,0 @@ - - - - Welcome to Seattle! - - - -
-

- Class Lab 1 -

-
-
-

- Have you been to Pike Place Market? -

-
- - - \ No newline at end of file diff --git a/prompt-engineering.md b/prompt-engineering.md deleted file mode 100644 index f73a30c..0000000 --- a/prompt-engineering.md +++ /dev/null @@ -1,6 +0,0 @@ -# Question -**WHY** are social workers so underpaid? - -## Answer - -Public Funding: Many social workers are employed by government agencies or non-profit organizations that heavily rely on public funding. Fluctuations in public budgets can impact the available resources for salaries. From 8a527df07cda7680ade6596cc31f8a0d0efe72e6 Mon Sep 17 00:00:00 2001 From: YOUR FULL NAME Date: Fri, 23 Feb 2024 21:15:16 -0800 Subject: [PATCH 3/5] code template --- lab5a/index.html/app.js | 0 lab5a/index.html/index.html | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 lab5a/index.html/app.js create mode 100644 lab5a/index.html/index.html diff --git a/lab5a/index.html/app.js b/lab5a/index.html/app.js new file mode 100644 index 0000000..e69de29 diff --git a/lab5a/index.html/index.html b/lab5a/index.html/index.html new file mode 100644 index 0000000..e69de29 From fe4b984ea233f8d74a54207e7c37d8e132cdf47a Mon Sep 17 00:00:00 2001 From: YOUR FULL NAME Date: Fri, 23 Feb 2024 21:33:24 -0800 Subject: [PATCH 4/5] addedtests.jsfile --- lab5a/index.html/tests.js | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lab5a/index.html/tests.js diff --git a/lab5a/index.html/tests.js b/lab5a/index.html/tests.js new file mode 100644 index 0000000..f227665 --- /dev/null +++ b/lab5a/index.html/tests.js @@ -0,0 +1,51 @@ +'use strict'; + +// You should not modify anything in this file, but feel free to look through it! + +function testSum() { //eslint-disable-line + if (sum(4,7)[0] === 11 && sum(4,7)[1] === 'The sum of 4 and 7 is 11.') { + console.log('%c TEST FOR sum() PASSES', 'color: green'); + } else { + console.log('%c TEST FOR sum() FAILS', 'color: red'); + } +} + +function testMultiply() { //eslint-disable-line + if (multiply(5,9)[0] === 45 && multiply(5,9)[1] === 'The product of 5 and 9 is 45.') { + console.log('%c TEST FOR multiply() PASSES', 'color: green'); + } else { + console.log('%c TEST FOR multiply() FAILS', 'color: red'); + } +} + +function testSumAndMultiply() { //eslint-disable-line + if (sumAndMultiply(4, 7, 5)[0] === 16 && sumAndMultiply(4, 7, 5)[1] === 140 && sumAndMultiply(4, 7, 5)[2] === '4 and 7 and 5 sum to 16.' && sumAndMultiply(4, 7, 5)[3] === 'The product of 4 and 7 and 5 is 140.') { + console.log('%c TEST FOR sumAndMultiply() PASSES', 'color: green'); + } else { + console.log('%c TEST FOR sumAndMultiply() FAILS', 'color: red'); + } +} + +function testSumArray() { //eslint-disable-line + if (sumArray(testArray)[0] === 9 && sumArray(testArray)[1] === '2,3,4 was passed in as an array of numbers, and 9 is their sum.') { + console.log('%c TEST FOR sumArray() PASSES', 'color: green'); + } else { + console.log('%c TEST FOR sumArray() FAILS', 'color: red'); + } +} + +function testMultiplyArray() { //eslint-disable-line + if (multiplyArray(testArray)[0] === 24 && multiplyArray(testArray)[1] === 'The numbers 2,3,4 have a product of 24.') { + console.log('%c TEST FOR multiplyArray() PASSES', 'color: green'); + } else { + console.log('%c TEST FOR multiplyArray() FAILS', 'color: red'); + } +} + +function testMultiplyAnyArray() { //eslint-disable-line + if (multiplyAnyArray(testDynamicArray)[0] === 120 && multiplyAnyArray(testDynamicArray)[1] === 'The numbers 1,2,3,4,5 have a product of 120.') { + console.log('%c TEST FOR multiplyAnyArray() PASSES', 'color: green'); + } else { + console.log('%c TEST FOR multiplyAnyArray() FAILS', 'color: red'); + } +} From 9ebf2e38bb1b8d4c4e9b392854b881a884282090 Mon Sep 17 00:00:00 2001 From: YOUR FULL NAME Date: Fri, 23 Feb 2024 21:55:29 -0800 Subject: [PATCH 5/5] problemsolved --- lab5a/.DS_Store | Bin 0 -> 6148 bytes lab5a/index.html/app.js | 128 +++++++++++++++++++++++++++++++++++ lab5a/index.html/index.html | 32 +++++++++ lab5a/lab5a | 1 + 4 files changed, 161 insertions(+) create mode 100644 lab5a/.DS_Store create mode 160000 lab5a/lab5a diff --git a/lab5a/.DS_Store b/lab5a/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8a234cd6f108e5e83b8361f3a54455ea6d331acc GIT binary patch literal 6148 zcmeHK!AitH49(OPx_a58$KE`M!XCVjOZ|d93vR7gp|yKZ@Hn63A9&HPaDPScWfGQ_ zZo!ktl0fE7Gs#T)TAGH4+~TF26U~Syg)$~n3_FC^SqGA+g%@4iX7_1`gzM#`XVty#Mb9*_AP14D1yHZjvwa z1#U@e>)__N)@IOKC=2@q!EFd8u@u9XOYsRb3hWtAfL<{O!UC}$fk=Z5#=xI4@B_Gy BPw)T$ literal 0 HcmV?d00001 diff --git a/lab5a/index.html/app.js b/lab5a/index.html/app.js index e69de29..1ff8cc0 100644 --- a/lab5a/index.html/app.js +++ b/lab5a/index.html/app.js @@ -0,0 +1,128 @@ +'use strict'; +///////////////////////////////////// +/* Problem 1 (this is your demo that we'll solve in class) +Write a function called sum() that takes in two numbers as arguments and then returns an array where the first element is the sum of those numbers, and the second element is a concatenated string that EXACTLY follows this example and uses the values that were input into the function: + +"The sum of 4 and 7 is 11." + +Test this function by hand in the console to get it working, and when you think it is finished, uncomment the call for the testSum() function below and check the console to see if the test passes.*/ + +// Write your code here +function sum(a, b) { //eslint-disable-line + +} + +// Here is the test for sum(); uncomment it to run it +// testSum(4, 7); + +// Once you get the test passing, do an a-c-p cycle and synchronize the code between GitHub and your laptop. Don't forget to create a new branch for your work on the next question! + +///////////////////////////////////// +/* Problem 2 +Write a function called multiply() that takes in two numbers as arguments and returns an array where the first element is the product of those numbers, and the second element is a string that EXACTLY follows this example and uses the values that were input into the function: + +"The product of 5 and 9 is 45." + +Test this function by hand in the console to get it working, and when you think it is finished, uncomment the call for the testMultiply() function and see if the test passes.*/ + +// Write your code here +function multiply(a, b) { //eslint-disable-line + +} + +// Here is the test for multiply(); uncomment it to run it +// testMultiply(5,9); + +// Once you get the test passing, do an a-c-p cycle and synchronize the code between GitHub and your laptop. Don't forget to create a new branch for your work on the next question! + +///////////////////////////////////// +/* Problem 3 +Write a function called sumAndMultiply() that takes in three numbers as separate arguments and returns an array where the first element is the sum of those three numbers, the second element is the product of those three numbers, and the third and fourth elements are strings that EXACTLY follow this example and use the values that were input into the function: + +Third element: "4 and 7 and 5 sum to 16." +Fourth element: "The product of 4 and 7 and 5 is 140." + +IMPORTANT DETAIL: You may not use the arithmetic operators + and * in this function. To do addition, use your sum() function, and to do multiplication, use your multiply() function that you've already created. You're going to have to be resourceful to figure out how to do this. However, you may continue to use the + operator for string concatenation. + +Test this function by hand in the console to get it working, and when you think it is finished, uncomment the call for the testSumAndMultiply() function and see if the test passes.*/ + +// Write your code here +function sumAndMultiply(a, b, c) { //eslint-disable-line + +} + +// Here is the test for sumAndMultiply(); uncomment it to run it +// testSumAndMultiply(4,7,5); + +// Once you get the test passing, do an a-c-p cycle and synchronize the code between GitHub and your laptop. Don't forget to create a new branch for your work on the next question! + +///////////////////////////////////// +/* Problem 4 +Write a function called sumArray() that takes in an array of numbers as its single argument and then returns an array where the first element is the sum of the numbers in the array, and the second element is a string that EXACTLY follows this example and uses the values that were input into the function: + +"2,3,4 was passed in as an array of numbers, and 9 is their sum." + +IMPORTANT DETAIL: You may not use the arithmetic operator + in this function. To do addition, use your sum() function that you've already created. You're going to have to be resourceful to figure out how to do this. However, you may continue to use the + operator for string concatenation. + +Test this function by hand in the console to get it working, and when you think it is finished, uncomment the call for the testSumArray() function and see if the test passes.*/ + +// Write your code here +let testArray = [2, 3, 4]; //eslint-disable-line + +function sumArray(sumArr) { //eslint-disable-line + +} + +// Here is the test for sumArray(); uncomment it to run it + +// testSumArray(testArray); + +// Once you get the test passing, do an a-c-p cycle and synchronize the code between GitHub and your laptop. Don't forget to create a new branch for your work on the next question! + +///////////////////////////////////// +/* Problem 5 +Write a function called multiplyArray() that takes an array of numbers as its argument and returns an array whose first element is the product of those numbers, and the second element is a string that EXACTLY follows this example and uses the values that were input into the function: + +"The numbers 2,3,4 have a product of 24." + +IMPORTANT DETAIL: You may not use the arithmetic operator * in this function. To do multiplication, use your multiply() function that you've already created. You're going to have to be resourceful to figure out how to do this. This function should handle an array containing three elements. However, you may continue to use the + operator for string concatenation. + +Test this function by hand in the console to get it working, and when you think it is finished, uncomment the call for the testMultiplyArray() function and see if the test passes.*/ + +// Write your code here +function multiplyArray(multArr) { //eslint-disable-line + +} + +// Here is the test for multiplyArray(); uncomment it to run it +// testMultiplyArray(testArray); + +// Once you get the test passing, do an a-c-p cycle and synchronize the code between GitHub and your laptop. + +// You're done! Submit the link to the repo following the instructions in Canvas. Or, try out the stretch goal below... + +// Don't forget to create a new branch for your work on the next question, if you attempt it. + +///////////////////////////////////// +/* STRETCH GOAL: Problem 6 +Write a function called multiplyAnyArray() that takes an array of numbers of any length as its argument and returns an array whose first element is the product of those numbers, and the second element is a string that EXACTLY follows this example and concatenates a message using the arguments that were passed into the function: + +"The numbers 1,2,3,4,5 have a product of 120." + +IMPORTANT DETAIL: You may not use the arithmetic operator * in this function. To do multiplication, use your multiply() function that you've already created. You're going to have to be resourceful to figure out how to do this. However, you may continue to use the + operator for string concatenation. + +This function should be dynamic, accepting an array of any length. + +Test this function by hand in the console to get it working, and when you think it is finished, uncomment the call for the testMultiplyAnyArray() function and see if the test passes.*/ + +// Write your code here +let testDynamicArray = [1,2,3,4,5]; //eslint-disable-line + +function multiplyAnyArray(dynamicArray) { //eslint-disable-line + +} + +// Here is the test for multiplyArray(); uncomment it to run it +// testMultiplyAnyArray(testDynamicArray); + +// Once you get the test passing, do an a-c-p cycle and synchronize the code between GitHub and your laptop. You're done! Submit the link to the repo following the instructions in Canvas. diff --git a/lab5a/index.html/index.html b/lab5a/index.html/index.html index e69de29..d6eb61b 100644 --- a/lab5a/index.html/index.html +++ b/lab5a/index.html/index.html @@ -0,0 +1,32 @@ + + + + + Lab 5 + + + +

Lab 5

+ +

sum()

+

+ +

multiply()

+

+ +

sumAndMultiply()

+

+ +

sumArray()

+

+ +

multiplyArray()

+

+ +

multiplyAnyArray()

+

+ + + + + \ No newline at end of file diff --git a/lab5a/lab5a b/lab5a/lab5a new file mode 160000 index 0000000..3e9812a --- /dev/null +++ b/lab5a/lab5a @@ -0,0 +1 @@ +Subproject commit 3e9812a9de63bcb8f5daa23960e5414fa0eddff7