From ae40ad9a9fed4096c4ad9459e2d20b84bb0f2612 Mon Sep 17 00:00:00 2001 From: harshasukhdeve Date: Wed, 29 Apr 2020 08:19:27 +0530 Subject: [PATCH 1/2] update file --- app.js | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++- index.html | 11 ++++++ 2 files changed, 118 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index ab3ad10..e14ec9d 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,9 @@ // Important Note - No Built-in functions to be used // Progression 1: Names and Input +var Prograd_1="Harsha"; +console.log(Prograd_1); +var Prograd_2="FacePrep" +console.log(Prograd_2); // 1.1 Create a variable `ProGrad-1` with the driver's name. // 1.2 Print `"The driver's name is XXXX"`. @@ -11,30 +15,131 @@ // - The driver has the longest name, it has XX characters. or // - It seems that the navigator has the longest name, it has XX characters. or // - Wow, you both have equally long names, XX characters!. - +if(Prograd_1.length>Prograd_2.length) +{ + console.log("The driver has the longest name, it has "+Prograd_1+ "characters"); +} +else if(Prograd_1.lenghth= 0; j--) { + navigatorName += Prograd_2[j]; +} + console.log(navigatorName); // 3.3 Merge both the characters such that driver is followed by Navigator like "ProGrad FACEPrep" // - Now bring the FACEPrep to the start and send ProGrad to the back like "FACEPrep ProGrad" - +console.log(Prograd_1.concat(" ",Prograd_2)); +console.log(Prograd_2.concat(" ",Prograd_1)); // 3.3 Depending on the lexicographic order of the strings, print: // - The driver's name goes first. // - Yo, the navigator goes first definitely. // - What?! You both have the same name? + +if (Prograd_1.toLowerCase() < Prograd_2.toLowerCase()) { + console.log("The driver's name goes first"); + } else if (Prograd_1.toLowerCase() > Prograd_2.toLowerCase()) { + console.log("Yo, the navigator goes first definitely"); + } else { + console.log("What?! You both got the same name?"); + } + // Bonus Time! // Bonus 1: // Go to lorem ipsum generator and: diff --git a/index.html b/index.html index e69de29..88ec4b5 100644 --- a/index.html +++ b/index.html @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file From 96e3642d61709499260f45a764ec473875f859a2 Mon Sep 17 00:00:00 2001 From: harshasukhdeve Date: Wed, 29 Apr 2020 08:26:29 +0530 Subject: [PATCH 2/2] update file --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index e14ec9d..8501a00 100644 --- a/app.js +++ b/app.js @@ -25,7 +25,7 @@ else if(Prograd_1.lenghth