From e5543b394f53cb8a3d9c1bf1daf5a2384ad437b9 Mon Sep 17 00:00:00 2001 From: Mielyn Acosta Date: Sat, 6 Oct 2018 15:42:50 -0400 Subject: [PATCH 1/3] Defined variables in exercises --- pset1.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/pset1.js b/pset1.js index da1c583..d6bf37a 100644 --- a/pset1.js +++ b/pset1.js @@ -6,7 +6,12 @@ that stores your full name as a variable */ + +/* +P1: +let myFullName = 'Mielyn Acosta' +*/ // ------------------------------------------- /* @@ -16,6 +21,12 @@ */ +/* +P2: + + let myHeight = 64; + +/* // ------------------------------------------- /* P3: @@ -23,7 +34,13 @@ that stores your year of birth */ +/* +P3: + +let myBirthYear = 1988; + +*/ // ------------------------------------------- /* P4: @@ -31,7 +48,13 @@ that stores current year */ +/* +P4: + +ley currenYear = 2018; + +*/ // ------------------------------------------- /* P5: @@ -40,7 +63,14 @@ from `myBirthYear` and `curentYear` */ +/* +P5: + +let myAge = currentYear - myAge; + + +*/ // ------------------------------------------- /* P6: @@ -53,7 +83,14 @@ */ +/* +P6: + +let myDescription = "Hello, my name is [myFullName] and I am [myAge] years old. + my height is [myHeight] inches. We are in the year of [currentYear]. + +*/ // ------------------------------------------- From ba02a2f86920d1f365abfeded6b7b9e4af2e7301 Mon Sep 17 00:00:00 2001 From: Mielyn Acosta Date: Sat, 6 Oct 2018 16:02:25 -0400 Subject: [PATCH 2/3] modified P6 --- pset1.js | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/pset1.js b/pset1.js index d6bf37a..2bfd7d8 100644 --- a/pset1.js +++ b/pset1.js @@ -7,11 +7,10 @@ */ -/* -P1: + let myFullName = 'Mielyn Acosta' -*/ + // ------------------------------------------- /* @@ -21,12 +20,11 @@ let myFullName = 'Mielyn Acosta' */ -/* -P2: + let myHeight = 64; -/* + // ------------------------------------------- /* P3: @@ -34,13 +32,11 @@ P2: that stores your year of birth */ -/* -P3: + let myBirthYear = 1988; -*/ // ------------------------------------------- /* P4: @@ -48,13 +44,11 @@ let myBirthYear = 1988; that stores current year */ -/* -P4: -ley currenYear = 2018; + +let currentYear = 2018; -*/ // ------------------------------------------- /* P5: @@ -63,14 +57,12 @@ ley currenYear = 2018; from `myBirthYear` and `curentYear` */ -/* -P5: -let myAge = currentYear - myAge; + +let myAge = currentYear - myBirthYear; -*/ // ------------------------------------------- /* P6: @@ -83,14 +75,12 @@ let myAge = currentYear - myAge; */ -/* -P6: -let myDescription = "Hello, my name is [myFullName] and I am [myAge] years old. - my height is [myHeight] inches. We are in the year of [currentYear]. +let myDescription = "Hello, my name is " + myFullName + " and I am " + myAge + " years old." + + "my height is" + myHeight + "inches." + " We are in the year of " + currentYear. -*/ + console.log(myDescription); // ------------------------------------------- From 3b5620c6e842a977ad871ca8631877834be374b2 Mon Sep 17 00:00:00 2001 From: Mielyn Acosta Date: Sat, 6 Oct 2018 16:49:27 -0400 Subject: [PATCH 3/3] completed exercises 2 --- pset2.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pset2.js b/pset2.js index 98d7b32..69c6dc4 100644 --- a/pset2.js +++ b/pset2.js @@ -3,24 +3,32 @@ // pleae create: // a variable called `helloWrold`, you can set it equal to whatever you want - +let helloWorld = 'Hello Mielyn' ; +console.log(helloWorld); // a variable called `this_is_snake_cased`, you can set it equal to whatever you want - +let this_is_snake_cased = 'MielynAcostaJoiningPuruit' ; +console.log(this_is_snake_cased); // a variable called `thisVarHasNumbers111`, you can set it equal to whatever you want - - +let thisVarHasNumbers111 = 2018; +console.log(thisVarHasNumbers111); // 1. create a string - it should be your first name - +let myString = 'Mielyn '; +console.log("My First name is " + myString); // 2. create another string - it should be your last name - - +let myString2 = 'Acosta'; +console.log("My last name is: " + myString2); // 3. create a third string using the first two strings you've defined // it should read [FIRST NAME][SPACE][LAST NAME] - +let myString3 = myString + ' ' + myString2; +console.log("My Full Name is: " + myString3); // 4. create a string - it should be your middle name - +let myString4 = 'De Lara'; +console.log("My Middle name is " + myString4); // 5. redefine the string in step 3. so that it now shows // [FIRST NAME][SPACE][MIDDLE NAME][SPACE][LAST NAME] + +let myString5 = myString + ' ' + myString4 + ' ' + myString2; +console.log("My Full name with middle name is: " + myString5);