From 9ee3857cefba0df573112fd4ef49c73649ade357 Mon Sep 17 00:00:00 2001 From: Jessie Date: Fri, 21 Sep 2018 12:09:27 +1000 Subject: [PATCH 1/6] completed terminal questions --- app.js | 0 index.html | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 app.js create mode 100644 index.html diff --git a/app.js b/app.js new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html new file mode 100644 index 0000000..e69de29 From 28bf25d079964e24f091159dd3a025bd6ddaadc1 Mon Sep 17 00:00:00 2001 From: Jessie Date: Fri, 21 Sep 2018 12:14:47 +1000 Subject: [PATCH 2/6] completed terminal questions --- app.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/app.js b/app.js index e69de29..7603ac1 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,44 @@ +console.log('checkpoint') + + +/* +#### Assume your present working directory is `$ ~/buffy` + +1. Make two directories inside `~/buffy`: `scoobies` and `vamps` + +pwd +mkdir scoobies vamps + +2. Make files in `scoobies` named `buffy.txt`, `giles.txt` and `angel.txt` + +cd scoobies +touch buffy.txt giles.txt angle.txt + +3. Copy `angel.txt` into the `vamps` directory + +pwd // assume I'm in scoobies directory +cp angle.txt ~/wdi17/checkpoint/checkpoint1/vamps/ + + +4. Delete the `vamps` directory and everything inside it + +cd .. +rm -rf vamps +*/ + + +// JS Variables + +1. + +var captain; + +captain = 'Jack' + +2. + +var phrase = 'Oh ' + captain + ', my ' + captain + "!" + +// JS conditionals + + From 1c2b13050c4ccf547bbb18c51b94d50a540dc1cb Mon Sep 17 00:00:00 2001 From: Jessie Date: Fri, 21 Sep 2018 12:18:27 +1000 Subject: [PATCH 3/6] completed JS variables and conditionals --- app.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app.js b/app.js index 7603ac1..ac93975 100644 --- a/app.js +++ b/app.js @@ -41,4 +41,21 @@ var phrase = 'Oh ' + captain + ', my ' + captain + "!" // JS conditionals +1. + +var souls = 3; +var lifeRafts = 2; + +if (souls > lifeRafts) { + console.log ("SOS") +} + +// Data Structures - JS Arrays + + + + + + + From 0273e24c3dea376143d1291d5d3564958b4957ba Mon Sep 17 00:00:00 2001 From: Jessie Date: Fri, 21 Sep 2018 12:23:44 +1000 Subject: [PATCH 4/6] completed data structures section --- app.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index ac93975..53dd965 100644 --- a/app.js +++ b/app.js @@ -33,11 +33,11 @@ rm -rf vamps var captain; -captain = 'Jack' +captain = 'Jack'; 2. -var phrase = 'Oh ' + captain + ', my ' + captain + "!" +var phrase = 'Oh ' + captain + ', my ' + captain + "!"; // JS conditionals @@ -47,11 +47,23 @@ var souls = 3; var lifeRafts = 2; if (souls > lifeRafts) { - console.log ("SOS") + console.log ("SOS"); } // Data Structures - JS Arrays +var weekend = ['Saturday']; + +weekend.push('Sunday'); + +weekend.unshift('Friday'); + +var day = weekend[1]; + +weekend.shift(); + + + From aa68d96bfc56c3942ac0b87c953454e3bca9e615 Mon Sep 17 00:00:00 2001 From: Jessie Date: Fri, 21 Sep 2018 12:35:18 +1000 Subject: [PATCH 5/6] completed data structures objects section --- app.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app.js b/app.js index 53dd965..c68be46 100644 --- a/app.js +++ b/app.js @@ -63,6 +63,29 @@ var day = weekend[1]; weekend.shift(); +// Data Structures - JS Objects + +var brain = { + energyLevel: 10 +}; + +var energy = brain.energyLevel; + +brain.dream = 'electric sheep'; + +brain.dayDream = { + lunch: ['burger', 'beer'] +}; + +brain.dayDream.lunch.push('pudding'); + + + + + + + + From be8c662ee86be1dd8474fbee8025634f847c3377 Mon Sep 17 00:00:00 2001 From: Jessie Date: Fri, 21 Sep 2018 12:38:08 +1000 Subject: [PATCH 6/6] completed quiz --- README.md | 24 +++++++++++++++++------- app.js | 10 +++++----- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c8d2d5c..a48b622 100644 --- a/README.md +++ b/README.md @@ -5,24 +5,34 @@ #### Assume your present working directory is `$ ~/buffy` 1. Make two directories inside `~/buffy`: `scoobies` and `vamps` -


+ +pwd +mkdir scoobies vamps 2. Make files in `scoobies` named `buffy.txt`, `giles.txt` and `angel.txt` -


+ +cd scoobies +touch buffy.txt giles.txt angle.txt 3. Copy `angel.txt` into the `vamps` directory -

+ +pwd // assume I'm in scoobies directory +cp angle.txt ~/wdi17/checkpoint/checkpoint1/vamps/ + 4. Delete the `vamps` directory and everything inside it -

-### JS Variables +cd .. +rm -rf vamps +### JS Variables +(pls see JS file) 1. Assign the string "Jack" to a variable called `captain` -

+ + 2. Using the `captain` variable, use string concatenation to form the string "Oh Jack, my Jack!", assigning it to a variable named `phrase` -

+ ### JS Conditionals diff --git a/app.js b/app.js index c68be46..b3c58a3 100644 --- a/app.js +++ b/app.js @@ -80,13 +80,13 @@ brain.dayDream = { brain.dayDream.lunch.push('pudding'); +// JS Functions +function areaOfRect(height, width) { + return height * width; +} - - - - - +var result = areaOfRect(3, 4);