From c3100d5b98216ebd8fa5a67d9a95de7f20dd05b3 Mon Sep 17 00:00:00 2001 From: Dan Roche Date: Sun, 22 Sep 2019 15:34:04 +0100 Subject: [PATCH 1/7] added newfile.js --- newfile.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 newfile.js diff --git a/newfile.js b/newfile.js new file mode 100644 index 000000000..e69de29bb From 8df9053fc574c5e833bcc2b8dd48492c6b8f1e2a Mon Sep 17 00:00:00 2001 From: Dan Roche Date: Wed, 25 Sep 2019 20:42:22 +0100 Subject: [PATCH 2/7] added homework.html --- Lesson02-HTML-CSS/homework/homework.html | 44 +++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/Lesson02-HTML-CSS/homework/homework.html b/Lesson02-HTML-CSS/homework/homework.html index b722c6acc..a77a299f9 100644 --- a/Lesson02-HTML-CSS/homework/homework.html +++ b/Lesson02-HTML-CSS/homework/homework.html @@ -1 +1,43 @@ - \ No newline at end of file + + + + + Dan's HTML homework + + + +
+

Dan Roche

+

Lamda School

+

HTML/CSS homework

+
+ +
+ Fresh from the sea, grilled with lemon squeezed on topLittle Georgia +
+ +
+
    +
  • Seafood
  • + +
  • Pasta
  • + +
+
+ + + + \ No newline at end of file From c56e2d172445c293bddf3ddea3c89e6e41b5dd5d Mon Sep 17 00:00:00 2001 From: danroche10 Date: Wed, 25 Sep 2019 21:11:21 +0100 Subject: [PATCH 3/7] added Style.css --- Lesson02-HTML-CSS/homework/Style.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Lesson02-HTML-CSS/homework/Style.css diff --git a/Lesson02-HTML-CSS/homework/Style.css b/Lesson02-HTML-CSS/homework/Style.css new file mode 100644 index 000000000..2cb7b156f --- /dev/null +++ b/Lesson02-HTML-CSS/homework/Style.css @@ -0,0 +1,14 @@ + + #ThirdDiv { height: 600px; width: 500px; background-color: powderblue; padding: 50px; border-style: solid; border-color: red; + border-width: 5px; + + } + + #SpanID { font-size: 18px; font-style: italic; margin: 50px; + + } + + .DivClass { + + } + \ No newline at end of file From c7076b84bc10932d07303fbe76ce7f43d92f0e57 Mon Sep 17 00:00:00 2001 From: danroche10 Date: Sun, 29 Sep 2019 18:48:55 +0100 Subject: [PATCH 4/7] added new file, homework.css --- .../homework/homework.css | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/Lesson03-CSS-Positioning/homework/homework.css b/Lesson03-CSS-Positioning/homework/homework.css index a45394a92..bb331a9c9 100644 --- a/Lesson03-CSS-Positioning/homework/homework.css +++ b/Lesson03-CSS-Positioning/homework/homework.css @@ -7,7 +7,7 @@ in this folder, you are in the wrong place. /* Exercise One: Centering the text in a span */ /* We will start this one off for you: */ -#exerciseOne { +#exerciseOne {display:block; text-align:center; } @@ -16,28 +16,107 @@ in this folder, you are in the wrong place. /* Place code here */ +#exerciseTwo { + display:none +} + /* Exercise Three: */ /* Place code here */ +#exerciseThree { + position: absolute; + top: 100px; + left: 200px; + +} + /* Exercise Four: */ /* Place code here */ +#exerciseFour { + + position: fixed; + top: 0px; + left: 0px; + + +} + /* Exercise Five */ /* Place code here */ +#exercisefive { + + display: flex; + align-items: center; + justify-content: space-between; + + + /* Exercise Six */ +flex-direction: row-reverse; + +} + +/* Exercise Seven */ + + #exerciseSeven { display: flex; + flex-direction: column-reverse; + width: 600px; + height: 500px; + border: 5px solid black; + background-color: grey; + align-items: center; + justify-content: space-between; +} + +.itemSpan { + display: block; + text-align: left; + align-self: center; +} + +.items { + width: 100px; + height: 100px; + display: flex; + background-color: white; + + } + +#itemOne { + border: 3px solid green; + align-self: flex-start; +} + +#itemTwo { + width: 150px; + height: 150px; + border: 4px dashed orange; +} + +#itemThree { + border: 3px solid blue; +} + +#itemFour { + border: 4px dashed red; + align-self: flex-end; + + +} \ No newline at end of file From dc2e36c365e8fce1c2948875f663d4d1a33ff398 Mon Sep 17 00:00:00 2001 From: danroche10 Date: Wed, 9 Oct 2019 21:43:34 +0100 Subject: [PATCH 5/7] added new file, homework.js --- Lesson04-JS-I/homework/homework.js | 113 +++++++++++++++++++++-------- 1 file changed, 84 insertions(+), 29 deletions(-) diff --git a/Lesson04-JS-I/homework/homework.js b/Lesson04-JS-I/homework/homework.js index 0d3fc31dd..3c095d3cc 100755 --- a/Lesson04-JS-I/homework/homework.js +++ b/Lesson04-JS-I/homework/homework.js @@ -1,22 +1,22 @@ //In these first 6 questions, replace `null` with the answer //create a string variable, it can contain anything -const newString = null ; +const newString = 'string' ; //create a number variable, it an be any number -const newNum = null ; +const newNum = 5 ; //create a boolean variable -const newBool = null ; +const newBool = 10>9 ; //solve the following math problem -const newSubtract = 10 - null === 5; +const newSubtract = 10 - 5 === 5; //Solve the following math problem -const newMultiply = 10 * null === 40 ; +const newMultiply = 10 * 4 === 40 ; //Solve the following math problem: -const newModulo = 21 % 5 === null ; +const newModulo = 21 % 5 === 1 ; @@ -26,126 +26,181 @@ const newModulo = 21 % 5 === null ; //Do not change any of the function names function returnString(str) { - //simply return the string provided: str + + return str; + } function add(x, y) { - // x and y are numbers - // add x and y together and return the value - // code here + return x + y; } function subtract(x, y) { - // subtract y from x and return the value - // code here + return x - y; } function multiply(x, y) { - // multiply x by y and return the value - // code here + return x * y; } function divide(x, y) { - // divide x by y and return the value - // code here + return x / y; } function areEqual(x, y) { // return true if x and y are the same // otherwise return false - // code here + if (x==y) { + return true + } else { + return false + } + + + } function areSameLength(str1, str2) { // return true if the two strings have the same length // otherwise return false - // code here + + if (str1.length==str2.length) { + return true + } else { + return false + } + + + + } function lessThanNinety(num) { // return true if the function argument: num , is less than ninety // otherwise return false - // code here + + + if (num<90) { + return true + } else { + return false + } } function greaterThanFifty(num) { // return true if num is greater than fifty // otherwise return false - // code here + if (num>50) { + return true + } else { + return false + } } function getRemainder(x, y) { // return the remainder from dividing x by y // code here + +return x % y; + } function isEven(num) { // return true if num is even // otherwise return false - // code here + + + if (num % 2 == 0) { + return true + } else { + return false + } } function isOdd(num) { // return true if num is odd // otherwise return false - // code here + + + if (num % 2 !== 0) { + return true + } else { + return false + } } function square(num) { // square num and return the new value // hint: NOT square root! - // code here + return Math.pow(num,2); } function cube(num) { // cube num and return the new value - // code here + return Math.pow(num,3); } function raiseToPower(num, exponent) { // raise num to whatever power is passed in as exponent - // code here + return Math.pow(num,exponent); } function roundNumber(num) { // round num and return it - // code here + return Math.round(num); } function roundUp(num) { // round num up and return it - // code here + return Math.ceil(num); } function addExclamationPoint(str) { // add an exclamation point to the end of str and return the new string // 'hello world' -> 'hello world!' - // code here -} + + return (str + '!'); + + } + + + + + function combineNames(firstName, lastName) { // return firstName and lastName combined as one string and separated by a space. // 'Lambda', 'School' -> 'Lambda School' // code here + return (firstName + " " + lastName) } function getGreeting(name) { // Take the name string and concatenate other strings onto it so it takes the following form: // 'Sam' -> 'Hello Sam!' // code here + return ('Hello' + " " + name + '!'); } + + + + // The next three questions will have you implement math area formulas. // If you can't remember these area formulas then head over to Google. function getRectangleArea(length, width) { // return the area of the rectangle by using length and width // code here + product = length*width + return product; } function getTriangleArea(base, height) { // return the area of the triangle by using base and height // code here + product = 0.5*base*height + return product; } // Do not modify code below this line. From 0bf20268a7b886fc8c69e5850a3269e7a9c7113c Mon Sep 17 00:00:00 2001 From: danroche10 Date: Sun, 13 Oct 2019 12:19:23 +0100 Subject: [PATCH 6/7] added new file (lesson 5), homework.js --- Lesson05-JS-II/homework/homework.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Lesson05-JS-II/homework/homework.js b/Lesson05-JS-II/homework/homework.js index 6f97f8d61..5c14ebda2 100755 --- a/Lesson05-JS-II/homework/homework.js +++ b/Lesson05-JS-II/homework/homework.js @@ -3,6 +3,7 @@ function getBiggest(x, y) { // x and y are integers. Return the larger integer // if they are the same return either one + if(x>y) {return x } else if (y>x) {return y} else if (y==x) {return x} } function greeting(language) { @@ -11,16 +12,31 @@ function greeting(language) { // language: 'Mandarin' -> 'Ni Hao!' // language: 'Spanish' -> 'Hola!' // if language is undefined return 'Hello!' + +if(language == 'German') {return 'Guten Tag!'} +else if (language == 'Mandarin') {return 'Ni Hao!'} +else if (language == 'Spanish') {return 'Hola!'} +else {return 'Hello!'} + } + function isTenOrFive(num) { // return true if num is 10 or 5 // otherwise return false +if (num==10 || num==5) {return true} +else {return false} + } function isInRange(num) { // return true if num is less than 50 and greater than 20 // otherwise return false + + if (num<50 && num>20) {return true} + else {return false} + + } function isInteger(num) { @@ -30,6 +46,9 @@ function isInteger(num) { // -10 -> true // otherwise return false // hint: you can solve this using Math.floor + if (num % 1 == 0) {return true} + else {return false} + } function fizzBuzz(num) { @@ -37,6 +56,10 @@ function fizzBuzz(num) { // if num is divisible by 5 return 'buzz' // if num is divisible by 3 & 5 return 'fizzbuzz' // otherwise return num + if (num % 3 == 0 && num % 5 == 0) {return 'fizzbuzz'} + else if (num % 5 == 0) {return 'buzz'} + else if (num % 3 == 0) {return 'fizz'} + else {return num} } function isPrime(num) { @@ -45,6 +68,12 @@ function isPrime(num) { // hint: a prime number is only evenly divisible by itself and 1 // hint2: you can solve this using a for loop // note: 0 and 1 are NOT considered prime numbers + + for(var i = 2; i < num; i++) + if(num % i === 0) return false; + return num > 1; + + } From 3dd34456b6adf505523d5a61a25698460508841f Mon Sep 17 00:00:00 2001 From: danroche10 Date: Mon, 4 Nov 2019 18:30:21 +0000 Subject: [PATCH 7/7] added new file, homework.js(6) --- Lesson06-JS-III/homework/homework.js | 53 +++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/Lesson06-JS-III/homework/homework.js b/Lesson06-JS-III/homework/homework.js index dd99592c7..be1b488bb 100644 --- a/Lesson06-JS-III/homework/homework.js +++ b/Lesson06-JS-III/homework/homework.js @@ -2,31 +2,53 @@ function returnFirst(arr) { // return the first item from the array + + return arr[0]; } + + function returnLast(arr) { // return the last item of the array + return arr[arr.length - 1]; } function getArrayLength(arr) { // return the length of the array + + return arr.length } function incrementByOne(arr) { // arr is an array of integers // increase each integer by one // return the array + + + + return new_arr = arr.map(i => i+1); + + + + + } function addItemToArray(arr, item) { // add the item to the end of the array // return the array + + arr.push(item); + return arr; } function addItemToFront(arr, item) { // add the item to the front of the array // return the array // hint: use the array method .unshift + + arr.unshift(item); + return arr } function wordsToSentence(words) { @@ -34,34 +56,63 @@ function wordsToSentence(words) { // return a string that is all of the words concatenated together // spaces need to be between each word // example: ['Hello', 'world!'] -> 'Hello world!' + return words.join(' '); } function contains(arr, item) { // check to see if item is inside of arr // return true if it is, otherwise return false + + return arr.includes(item); } function addNumbers(numbers) { // numbers is an array of integers. // add all of the integers and return the value + + return numbers.reduce((a,b) => a + b, 0) + r } function averageTestScore(testScores) { // testScores is an array. Iterate over testScores and compute the average. // return the average + + return testScores.reduce((a,b) => a + b, 0) / testScores.length + + } function largestNumber(numbers) { // numbers is an array of integers // return the largest integer + return numbers.reduce(function(a,b){ + return Math.max(a,b); + }, 0); + } -function multiplyArguments() { +function multiplyArguments(...param1) { // use the arguments keyword to multiply all of the arguments together and return the product // if no arguments are passed in return 0 // if one argument is passed in just return it + var product = 1; + + if (arguments.length === 0) { + return 0; + } else if (arguments.length === 1) { + return arguments[0]; + } + + for (var i = 0; i < arguments.length; i++) { + product *= arguments[i]; + } + return product; + } + + // Do not modify code below this line. // --------------------------------