From d2ae2082a7be9ab8af5f4c0e911adf6900173dbf Mon Sep 17 00:00:00 2001 From: Mateo Sancho Date: Wed, 8 Oct 2025 16:15:45 +0200 Subject: [PATCH 1/2] Finished --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 294f6b2..630965f 100644 --- a/index.js +++ b/index.js @@ -8,11 +8,10 @@ const s4 = "bread"; const s5 = "and"; // Concatenate the string variables into one new string - +const tongueTwister = s1 + " " + s2 + " " + s3 + " " + s4 + " " + s5; // Print out the concatenated string - - +console.log(tongueTwister) /******************************************* From 747a6236c435fefea21497fdc6777ed6e6d1bbbc Mon Sep 17 00:00:00 2001 From: Mateo Sancho Date: Sun, 12 Oct 2025 22:29:16 +0200 Subject: [PATCH 2/2] Finished --- index.js | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/index.js b/index.js index 630965f..aed3958 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,6 @@ const tongueTwister = s1 + " " + s2 + " " + s3 + " " + s4 + " " + s5; // Print out the concatenated string console.log(tongueTwister) - /******************************************* Iteration 1.2 | Camel Tail *******************************************/ @@ -21,11 +20,17 @@ const part1 = "java"; const part2 = "script"; // Convert the last letter of part1 and part2 to uppercase and concatenate the strings - +let part1UpperCase = part1; +part1UpperCase = part1UpperCase.slice(part1UpperCase.length - 1); +part1UpperCase = part1UpperCase.toUpperCase(); +let part2UpperCase = part2; +part2UpperCase = part2UpperCase.slice(part2UpperCase.length - 1); +part2UpperCase = part2UpperCase.toUpperCase(); +const result = part1.slice(0,part1.length - 1) + part1UpperCase + part2.slice(0,part2.length - 1) + part2UpperCase; // Print the cameLtaiL-formatted string - +console.log(result) /******************************************* @@ -34,11 +39,11 @@ const part2 = "script"; const billTotal = 84; // Calculate the tip (15% of the bill total) - +let tipAmount = billTotal / 100; +tipAmount = tipAmount * 15 // Print out the tipAmount - - +console.log(tipAmount) /******************************************* @@ -46,10 +51,10 @@ const billTotal = 84; *******************************************/ // Generate a random integer between 1 and 10 (inclusive) - +const randomNumber = Math.floor(Math.random() * (10 - 1 + 1)) + 1; // Print the generated random number - +console.log(randomNumber) /******************************************* @@ -61,15 +66,16 @@ const b = false; // Try and guess the output of the below expressions first and write your answers down: const expression1 = a && b; - +console.log(expression1) const expression2 = a || b; - +console.log(expression2) const expression3 = !a && b; - +console.log(expression3) const expression4 = !(a && b); - +console.log(expression4) const expression5 = !a || !b; - +console.log(expression5) const expression6 = !(a || b); - -const expression7 = a && a; \ No newline at end of file +console.log(expression6) +const expression7 = a && a; +console.log(expression7) \ No newline at end of file