diff --git a/starter-code/basic-algorithms.js b/starter-code/basic-algorithms.js index 82f20d8ba..797072b11 100644 --- a/starter-code/basic-algorithms.js +++ b/starter-code/basic-algorithms.js @@ -1,7 +1,91 @@ -// Names and Input - - -//Conditionals - - -// Lorem ipsum generator +// Names and Input +var hacker1="Zacharia"; + + console.log(`the hacker's name is ${hacker1}`); + +var hacker2= window.prompt("And you are?"); + +console.log(`the navigator's name is ${hacker2}`); + +if (hacker1.length > hacker2.length){ + console.log(`The driver has the longest name, it has ${hacker1.length} letters`); + } + else if (hacker1.length == hacker2.length){ + console.log(`Wow, you both have equally long names, ${hacker1.length} characters each!`); + } + else{ + console.log(`Navigator has the longest name, it has ${hacker2.length} characters.`); + } + + for (i=0;i=0 ; i--){ + console.log(hacker2[i]); +} + +var names =[hacker1,hacker2]; + +for (i=0;i + + + + + + Document + + + + + + + \ No newline at end of file