diff --git a/solutions/01_hello_html/hello.html b/solutions/01_hello_html/hello.html index d975ef8..7e58405 100644 --- a/solutions/01_hello_html/hello.html +++ b/solutions/01_hello_html/hello.html @@ -1 +1,11 @@ -This is just an example! Hehe. \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/solutions/01_hello_html/hello.js b/solutions/01_hello_html/hello.js new file mode 100644 index 0000000..a2e3eda --- /dev/null +++ b/solutions/01_hello_html/hello.js @@ -0,0 +1 @@ +console.log("Hello, World!") \ No newline at end of file diff --git a/solutions/04_clickhandler/click.js b/solutions/04_clickhandler/click.js new file mode 100644 index 0000000..c101bf7 --- /dev/null +++ b/solutions/04_clickhandler/click.js @@ -0,0 +1,9 @@ +$(document).ready(function(){ + + $("div").click(function(){ + + var output = $(this).html(); + + console.log(output); + }); +}); \ No newline at end of file diff --git a/solutions/04_clickhandler/index.html b/solutions/04_clickhandler/index.html new file mode 100644 index 0000000..fbb940b --- /dev/null +++ b/solutions/04_clickhandler/index.html @@ -0,0 +1,11 @@ + + + + + + + +
Hello
+
bye
+ + \ No newline at end of file diff --git a/solutions/09a_length/index.html b/solutions/09a_length/index.html new file mode 100644 index 0000000..ca722ac --- /dev/null +++ b/solutions/09a_length/index.html @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/solutions/09a_length/length.js b/solutions/09a_length/length.js new file mode 100644 index 0000000..e0f92da --- /dev/null +++ b/solutions/09a_length/length.js @@ -0,0 +1,4 @@ + +var string= "This is just a string"; + +console.log(string.length); diff --git a/solutions/Conditionals/grade.js b/solutions/Conditionals/grade.js new file mode 100644 index 0000000..272d60d --- /dev/null +++ b/solutions/Conditionals/grade.js @@ -0,0 +1,14 @@ +var grade = 50; + +if(grade <= 65){ + console.log("F"); +} +else if(grade <= 74 ){ + console.log("C"); +} +else if(grade <= 89){ + console.log("B"); +} +else{ + console.log("A"); +} \ No newline at end of file diff --git a/solutions/js_loops/count10.js b/solutions/js_loops/count10.js new file mode 100644 index 0000000..0a1f107 --- /dev/null +++ b/solutions/js_loops/count10.js @@ -0,0 +1,3 @@ +for(var i = 1; i < 11; i++){ + console.log(i); +} \ No newline at end of file diff --git a/solutions/js_loops/count476.js b/solutions/js_loops/count476.js new file mode 100644 index 0000000..d36c7b6 --- /dev/null +++ b/solutions/js_loops/count476.js @@ -0,0 +1,3 @@ +for(var i = 1; i < 477; i++){ + console.log(i); +} \ No newline at end of file diff --git a/solutions/js_loops/prod15.js b/solutions/js_loops/prod15.js new file mode 100644 index 0000000..03a576d --- /dev/null +++ b/solutions/js_loops/prod15.js @@ -0,0 +1,6 @@ +var prod = 0; +var j = i; +for(var i = 1; i < 15; i++){ + prod *= j; +} +console.log(prod); \ No newline at end of file diff --git a/solutions/js_loops/sum128.js b/solutions/js_loops/sum128.js new file mode 100644 index 0000000..85c9c1a --- /dev/null +++ b/solutions/js_loops/sum128.js @@ -0,0 +1,5 @@ +var sum = 0; +for(var i = 1; i < 129; i++){ + sum += i; +} +console.log(sum); \ No newline at end of file diff --git a/solutions/js_loops/sum55.js b/solutions/js_loops/sum55.js new file mode 100644 index 0000000..68ffd2e --- /dev/null +++ b/solutions/js_loops/sum55.js @@ -0,0 +1,5 @@ +var sum = 0; +for(var i = 1; i < 56; i++){ + sum += i; +} +console.log(sum); \ No newline at end of file diff --git a/solutions/roman_numerals/roman.js b/solutions/roman_numerals/roman.js new file mode 100644 index 0000000..a49b9f9 --- /dev/null +++ b/solutions/roman_numerals/roman.js @@ -0,0 +1,22 @@ + var roman = { + M: 1000, + D: 500, + C: 100, + L: 50, + X: 10, + V: 5, + I: 1 + }; + + var num = 526; + var str = ''; //output + for(var letter in roman){ + var dummy = Math.floor(num/roman[letter]) + if(dummy > 0){ + for(var i = 1; i <= dummy; i++){ + str += letter; + num -= roman[letter]; + }; + }; + }; +console.log(str); \ No newline at end of file