From 90ac3933934bbf671f22d175e0d2d1545f811579 Mon Sep 17 00:00:00 2001 From: Bryan Choe Date: Wed, 13 Sep 2017 19:08:50 -1000 Subject: [PATCH 1/5] completes first 2 questions --- exercises.js | 58 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/exercises.js b/exercises.js index 54071d8..3f26295 100644 --- a/exercises.js +++ b/exercises.js @@ -29,6 +29,15 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * The function will return true if the number passed into the function is equal to or greater than Hawaii's voting age. Console.log your result. */ +function canVote(age){ + if(age>=18){ + return true; + } else { + return false; + } +} + +console.log('#1 canVote: ',canVote(19)); /* * #2 @@ -42,6 +51,13 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * Console.log your result. */ +function login(password){ + if(password === 'test1234'){ + return "Login Success!"; + } +} + +console.log('#2 Login: ',login('test1234')) /* * #3 @@ -80,7 +96,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * @param Datatype: String `word` * @return Datatype: String * - * The function will return the message "Word to Big Bird!", if the string passed into the function is a three-letter word. + * The function will return the message "Word to Big Bird!", if the string passed into the function is a three-letter word. * Console.log your result. */ @@ -95,7 +111,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * @param Datatype: String `second` * @return Datatype: String * - * If the strings are equal, the function will return the message "You look mahvelous!" Otherwise, return the message: "I don't know who you are anymore." + * If the strings are equal, the function will return the message "You look mahvelous!" Otherwise, return the message: "I don't know who you are anymore." * Console.log your result. */ @@ -109,7 +125,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * @param Datatype: String `second` * @return Datatype: String * - * If the strings are not equal, the function will return the message "Opposites do attract." Otherwise, return the message: "Cause it's like you're my mirror." + * If the strings are not equal, the function will return the message "Opposites do attract." Otherwise, return the message: "Cause it's like you're my mirror." * Console.log your result. */ @@ -124,7 +140,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * * The function will return true if the number passed into the function is greater than 100, otherwise it will return false. * Console.log your result. -*/ +*/ @@ -140,7 +156,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * * The function will return true if the sum of all the number values is greater than 30, otherwise it will return false. * Console.log your result. -*/ +*/ @@ -154,7 +170,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * * The function will return true if the number passed in is an even integer, otherwise it will return false. * Console.log your result. -*/ +*/ @@ -170,7 +186,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * * If BOTH values are 21 or over, the function will return the message: "Welcome to the Legends Lounge." Otherwise, it will return the message: "Chuck E Cheese is across the street." * Console.log your result. -*/ +*/ /* @@ -184,7 +200,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * * If EITHER the number value is greater than or equal to 120 or the boolean value is true, then the function will return the message: "Congratulations on a job well done." Otherwise, return the message: "See you in summer school." * Console.log your result. -*/ +*/ @@ -198,7 +214,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * * The function will return the message: "You are riding Honolulu's Rail.", if the number value is less than 50, otherwise it will return the message: "You are riding an Amtrak.", if the number value is less than 100, and return the message: "Now you ballin' in the Shinkansen!", if the number value is greater than or equal to 100. * Console.log your result. -*/ +*/ /* @@ -213,7 +229,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * Console.log budget and doughnutBought. * Invoke your function again. * Console.log budget and doughnutBought again. -*/ +*/ @@ -236,7 +252,7 @@ for (var i = 0; i Date: Wed, 13 Sep 2017 19:19:40 -1000 Subject: [PATCH 2/5] completes #6 --- exercises.js | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/exercises.js b/exercises.js index 3f26295..c33a19c 100644 --- a/exercises.js +++ b/exercises.js @@ -57,7 +57,7 @@ function login(password){ } } -console.log('#2 Login: ',login('test1234')) +console.log('#2 Login: ',login('test1234')); /* * #3 @@ -72,7 +72,15 @@ console.log('#2 Login: ',login('test1234')) * Console.log your result. */ +function isGreaterThan(first,second){ + if(first>second){ + return true; + } else { + return false; + } +} +console.log(isGreaterThan(3,5)); /* * #4 @@ -86,6 +94,16 @@ console.log('#2 Login: ',login('test1234')) * Console.log your result. */ +function mustBeTrue(boo){ + if(boo === true){ + return true; + } else { + return false; + } + +} + +console.log('mustbeTrue: ',mustBeTrue('three' === 3)); /* @@ -100,7 +118,15 @@ console.log('#2 Login: ',login('test1234')) * Console.log your result. */ +function bigBird(word){ + if(word.length === 3){ + return 'word to big bird!'; + } else { + return 'false' + } +} +console.log(bigBird('bobhjnfiokdshiouafh')); /* * #6 @@ -115,6 +141,15 @@ console.log('#2 Login: ',login('test1234')) * Console.log your result. */ +function isEqual(first,second){ + if(first === second){ + return 'You look mahvelous!'; + } else { + return 'You know nothing jon snow'; + } +} + +console.log(isEqual('yin','yang')); /* * #7 From f184066ead585c3bd595cd21d623feba6c93a48a Mon Sep 17 00:00:00 2001 From: Bryan Choe Date: Sat, 28 Oct 2017 14:50:45 -1000 Subject: [PATCH 3/5] adds updated instructions on number 15 --- exercises.js | 74 +--------------------------------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/exercises.js b/exercises.js index c33a19c..6b8aac4 100644 --- a/exercises.js +++ b/exercises.js @@ -29,15 +29,6 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true * The function will return true if the number passed into the function is equal to or greater than Hawaii's voting age. Console.log your result. */ -function canVote(age){ - if(age>=18){ - return true; - } else { - return false; - } -} - -console.log('#1 canVote: ',canVote(19)); /* * #2 @@ -51,13 +42,6 @@ console.log('#1 canVote: ',canVote(19)); * Console.log your result. */ -function login(password){ - if(password === 'test1234'){ - return "Login Success!"; - } -} - -console.log('#2 Login: ',login('test1234')); /* * #3 @@ -72,15 +56,6 @@ console.log('#2 Login: ',login('test1234')); * Console.log your result. */ -function isGreaterThan(first,second){ - if(first>second){ - return true; - } else { - return false; - } -} - -console.log(isGreaterThan(3,5)); /* * #4 @@ -94,17 +69,6 @@ console.log(isGreaterThan(3,5)); * Console.log your result. */ -function mustBeTrue(boo){ - if(boo === true){ - return true; - } else { - return false; - } - -} - -console.log('mustbeTrue: ',mustBeTrue('three' === 3)); - /* * #5 @@ -118,15 +82,6 @@ console.log('mustbeTrue: ',mustBeTrue('three' === 3)); * Console.log your result. */ -function bigBird(word){ - if(word.length === 3){ - return 'word to big bird!'; - } else { - return 'false' - } -} - -console.log(bigBird('bobhjnfiokdshiouafh')); /* * #6 @@ -141,15 +96,6 @@ console.log(bigBird('bobhjnfiokdshiouafh')); * Console.log your result. */ -function isEqual(first,second){ - if(first === second){ - return 'You look mahvelous!'; - } else { - return 'You know nothing jon snow'; - } -} - -console.log(isEqual('yin','yang')); /* * #7 @@ -178,7 +124,6 @@ console.log(isEqual('yin','yang')); */ - /* * #9 * Function - dirty30 @@ -194,7 +139,6 @@ console.log(isEqual('yin','yang')); */ - /* * #10 * Function - evenStevens @@ -209,7 +153,6 @@ console.log(isEqual('yin','yang')); - /* * #11 * Function - daClub @@ -268,8 +211,6 @@ console.log(isEqual('yin','yang')); - - /* For loops - A for loop checks a condition a specific number of times and allows us to execute a code block and evaluate a condition to determine if our loop should run again. @@ -289,7 +230,7 @@ for (var i = 0; i Date: Sat, 28 Oct 2017 14:56:11 -1000 Subject: [PATCH 4/5] adds string to #18 --- exercises.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises.js b/exercises.js index 6b8aac4..5562b41 100644 --- a/exercises.js +++ b/exercises.js @@ -275,7 +275,7 @@ for (var i = 0; i Date: Wed, 10 Oct 2018 21:34:37 -1000 Subject: [PATCH 5/5] adds data type --- exercises.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises.js b/exercises.js index 85415cd..dbd4fe8 100644 --- a/exercises.js +++ b/exercises.js @@ -292,7 +292,7 @@ var players = ["Yao Ming", "BrookLin", " Jesus Shuttlesworth", "Manute Bol", "Si * Console.log your results. */ - var subOftheDay = ["Teriyaki Chicken", "Spicy Italian", "Turkey", "BMT", "Black Forest Ham", "Meatball Marinara", "Veggie"]; + var subOftheDay = ["Teriyaki Chicken", "Spicy Italian", "Turkey", "BMT", "Black Forest Ham", "Meatball Marinara", "Veggie", "Tuna"]; /*