From af21fa0791dcf789ac972e232fc15cc541390b7b Mon Sep 17 00:00:00 2001 From: Capicapilla Date: Tue, 18 Nov 2025 21:11:19 +0100 Subject: [PATCH 1/3] done --- .vscode/settings.json | 8 ++++++++ index.js | 29 +++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..eecbcdc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "github.copilot.enable": { + "*": false, + "plaintext": false, + "markdown": false, + "scminput": false + } +} \ No newline at end of file diff --git a/index.js b/index.js index 294f6b2..a5e72ac 100644 --- a/index.js +++ b/index.js @@ -9,11 +9,11 @@ const s5 = "and"; // Concatenate the string variables into one new string +let newString = s1 + ", " + s2 + ", " + s3 + ", " + s4 + ", " + s5; // Print out the concatenated string - - +console.log(newString); /******************************************* Iteration 1.2 | Camel Tail @@ -23,10 +23,20 @@ const part2 = "script"; // Convert the last letter of part1 and part2 to uppercase and concatenate the strings +let upperCasePart1 = part1.slice(0, -1) + part1.slice(-1).toUpperCase(); -// Print the cameLtaiL-formatted string +console.log(upperCasePart1) + +let upperCasePart2 = part2.slice(0, -1) + part2.slice(-1).toUpperCase(); +console.log(upperCasePart1 + " " + upperCasePart2) + +let phraseComplete = upperCasePart1 + " " + upperCasePart2; + + +// Print the cameLtaiL-formatted string +console.log(phraseComplete) /******************************************* @@ -36,9 +46,11 @@ const billTotal = 84; // Calculate the tip (15% of the bill total) +let calculatedTotalPercent = (84 * 15) / 100; // Print out the tipAmount +console.log(calculatedTotalPercent); @@ -48,9 +60,11 @@ const billTotal = 84; // Generate a random integer between 1 and 10 (inclusive) +let randomNumber = Math.floor(Math.random() * 11); // Print the generated random number +console.log(randomNumber) /******************************************* @@ -62,15 +76,22 @@ 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 + " = " + "false") const expression2 = a || b; +console.log(expression2 + " = " + "true") const expression3 = !a && b; +console.log(expression3 + " = " + "false"); const expression4 = !(a && b); +console.log(expression4 + " = " + "true") const expression5 = !a || !b; +console.log(expression5 + " = " + "true") const expression6 = !(a || b); +console.log(expression5 + " = " + "true") -const expression7 = a && a; \ No newline at end of file +const expression7 = a && a; +console.log(expression7 + " = " + "true") \ No newline at end of file From 5ea73adb2415d759a76d7f0e19d981d8eedf361e Mon Sep 17 00:00:00 2001 From: Capicapilla Date: Tue, 18 Nov 2025 21:33:44 +0100 Subject: [PATCH 2/3] errors solvented --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a5e72ac..97ef28f 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ let upperCasePart2 = part2.slice(0, -1) + part2.slice(-1).toUpperCase(); console.log(upperCasePart1 + " " + upperCasePart2) -let phraseComplete = upperCasePart1 + " " + upperCasePart2; +let phraseComplete = upperCasePart1 + upperCasePart2; // Print the cameLtaiL-formatted string @@ -60,7 +60,7 @@ console.log(calculatedTotalPercent); // Generate a random integer between 1 and 10 (inclusive) -let randomNumber = Math.floor(Math.random() * 11); +let randomNumber = Math.floor(Math.random() * 10) + 1; // Print the generated random number From acc3668ef065798d57cf2ea59ad9305b6cefb64c Mon Sep 17 00:00:00 2001 From: Capicapilla Date: Wed, 19 Nov 2025 19:47:53 +0100 Subject: [PATCH 3/3] solvented again --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 97ef28f..3e86e27 100644 --- a/index.js +++ b/index.js @@ -10,10 +10,12 @@ const s5 = "and"; // Concatenate the string variables into one new string let newString = s1 + ", " + s2 + ", " + s3 + ", " + s4 + ", " + s5; +let newStringForm = `${s1} ${s2} ${s5} ${s3} ${s4}`; // Print out the concatenated string console.log(newString); +console.log(newStringForm) /******************************************* Iteration 1.2 | Camel Tail @@ -29,7 +31,7 @@ console.log(upperCasePart1) let upperCasePart2 = part2.slice(0, -1) + part2.slice(-1).toUpperCase(); -console.log(upperCasePart1 + " " + upperCasePart2) +console.log(upperCasePart1 + upperCasePart2) let phraseComplete = upperCasePart1 + upperCasePart2; @@ -47,10 +49,12 @@ const billTotal = 84; // Calculate the tip (15% of the bill total) let calculatedTotalPercent = (84 * 15) / 100; +let resultPercent = billTotal + calculatedTotalPercent // Print out the tipAmount console.log(calculatedTotalPercent); +console.log(resultPercent); @@ -91,7 +95,7 @@ const expression5 = !a || !b; console.log(expression5 + " = " + "true") const expression6 = !(a || b); -console.log(expression5 + " = " + "true") +console.log(expression6 + " = " + "false") const expression7 = a && a; console.log(expression7 + " = " + "true") \ No newline at end of file