From e6c9de95ca98a8e8d88232a8ef9f2564a3fdc8a3 Mon Sep 17 00:00:00 2001 From: Elizabeth Chan Date: Thu, 22 Aug 2019 20:32:52 -0400 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b80828..0d4ac57 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Example steps for question 4: 2. console.log number. - 3. Declare another variable roundedNumber that has the value of z but rounded to the nearest integer. + 3. Declare another variable roundedNumber that has the value of number but rounded to the nearest integer. 4. console.log number. From 4d761e8de8ca1a1977e603a4edfd6a1006245d92 Mon Sep 17 00:00:00 2001 From: kursad Date: Sun, 25 Aug 2019 15:22:05 -0400 Subject: [PATCH 2/2] Week6 submission --- script.js | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 script.js diff --git a/script.js b/script.js new file mode 100644 index 0000000..210010a --- /dev/null +++ b/script.js @@ -0,0 +1,131 @@ +// Question 1 +console.log ("Hello World!") +console.log ("Merhaba Dunya!") + +// Question 2 +console.log ("I'm awesome") + +//Question 3 + //i + let age + + //ii + console.log ("The value of age will be:Undefined") + + //iii + console.log(age) + + //iv + age=34 + + //v + console.log("The value of age will be:34") + + //vi + console.log(age) + +//Question 4 +let name = "Kursad" + + //i + console.log("the value of my string will be:Kursad") + + //ii + console.log(name) + + //iii + name = "Begum" + + //iv + console.log("the value of my string will be:Kursad") + + //v + console.log(name) + +//Question 5 + //i + let roundThenumber = 7.25 + + //ii + console.log(roundThenumber) + + //iii + let roundedNumber = Math.floor(roundThenumber) + + //iv + let highest + if (roundedNumber>roundThenumber) { + highest = roundedNumber + } else { + highest = roundThenumber + } + + //v + console.log(highest) + +//Question 6 + //i + let things = [] + + //ii + console.log("the value of my array will be an emty array") + + //iii + let favoriteAnimals = ["cat","dog","wolf"] + + //iv + console.log(favoriteAnimals) + + //vi + favoriteAnimals.push("kitten") + + //vii + console.log(favoriteAnimals) + +//Question 7 + //i + let myString = "this is a test" + + //ii + lengthOfmyString = myString.length + + //iii + console.log(lengthOfmyString) + +//Question 8 +let x = 7 +console.log(x) +x=x%3 +console.log("the value of x will be 1, because % is a remainder operator") +console.log(x) + +//Question 9 + //i + let differentTypearray = ["kursad",34] + + //ii + console.log(6/0 === 10/0) + +//Question 10 +const grid = [[0, 1], [1, 1], [2, 1], [3, 1]]; +console.log(grid[2][0]) + +//Question 11 +let counter = 0 +console.log(counter+=2) +console.log(counter = counter +2) +console.log(counter++) +console.log(++counter) + +//Question 12 +const name = "Prince" +const bestFriend = "Thomas" +const breed = "Domestic Shorthair" +const color = "Orange and Red Tabby" +let age = 1 +const sex = "male" +let hair = "short" + +//Question 13 +namesKittens = ["Kyle Meowry","Luna","Obi","Charlie","Raspberries"] +namesAdults = ["Mezzo", "Sabrina", "Josie"]