From cc71b1e4d46c4fd26aa6f04747e0e73d960dde81 Mon Sep 17 00:00:00 2001 From: "J. Gaspar Prieto" Date: Wed, 18 Oct 2017 09:32:45 +0200 Subject: [PATCH 1/2] DOne --- starter-code/basic-algorithms.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/starter-code/basic-algorithms.js b/starter-code/basic-algorithms.js index 82f20d8ba..4ef20cc3a 100644 --- a/starter-code/basic-algorithms.js +++ b/starter-code/basic-algorithms.js @@ -4,4 +4,8 @@ //Conditionals + + + + // Lorem ipsum generator From 9bf6ee6159f74eb90d27c1b7b3eaee8f6ba922c6 Mon Sep 17 00:00:00 2001 From: "J. Gaspar Prieto" Date: Sun, 22 Oct 2017 15:54:23 +0200 Subject: [PATCH 2/2] point 6 finish --- starter-code/basic-algorithms.js | 34 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/starter-code/basic-algorithms.js b/starter-code/basic-algorithms.js index 4ef20cc3a..c5602360e 100644 --- a/starter-code/basic-algorithms.js +++ b/starter-code/basic-algorithms.js @@ -1,11 +1,23 @@ -// Names and Input - - -//Conditionals - - - - - - -// Lorem ipsum generator +var hacker1 = prompt("Who is the name of driver`s:", "") ; +console.log("The driver's name is "+ hacker1); +var hacker2 = prompt("Who is the name of navigator`s", "") ; +console.log("The navigator's name is " + hacker2); +i = hacker1.length; +j = hacker2.length; + + +if ( hacker1.length < hacker2.length ){ + console.log("Yo, navigator got the longest name, it has "+ (j) +" characters"); +} else if (hacker1.length === hacker2.length){ + console.log("wow, you both got equally long names, "+ (i) +" characters!!"); + +} else{ + console.log("The Driver has the longest name, it has "+ (i) +" characters"); +} +console.log( hacker1.toUpperCase()); + + +console.log(hacker1.charAt()); +for (i = 0; i <= hacker1.length; i++){ + console.log(hacker1.charAt(i-1)); +} \ No newline at end of file