diff --git a/index.js b/index.js index 294f6b2..8a82a18 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,13 @@ const s3 = "Ted"; const s4 = "bread"; const s5 = "and"; +const tongueTwister = s1 + " " + s2 + " " + s3 + " " + s4 + " " + + s5 +" "+ + s3 + " " + s2 + " " + s1 + " " + s4; + +console.log(tongueTwister); + + // Concatenate the string variables into one new string @@ -16,11 +23,18 @@ const s5 = "and"; /******************************************* - Iteration 1.2 | Camel Tail + Iteration 1.2 | Camel Tail *******************************************/ const part1 = "java"; const part2 = "script"; +const part1Up = part1.slice(0, 3) + part1.slice(3).toUpperCase(); +const part2Up = part2.slice(0, 5) + part2.slice(5).toUpperCase(); +const result = part1Up + part2Up; +console.log(result); + + + // Convert the last letter of part1 and part2 to uppercase and concatenate the strings @@ -33,6 +47,8 @@ const part2 = "script"; Iteration 2.1 | Calculate Tip *******************************************/ const billTotal = 84; +const tipAmount = billTotal * 0.15; +console.log(tipAmount); // Calculate the tip (15% of the bill total) @@ -51,6 +67,8 @@ const billTotal = 84; // Print the generated random number +const randomNumber = Math.floor(Math.random() * 10 + 1); +console.log(randomNumber); /******************************************* @@ -73,4 +91,13 @@ const expression5 = !a || !b; const expression6 = !(a || b); -const expression7 = a && a; \ No newline at end of file +const expression7 = a && a; + +console.log(expression1); +console.log(expression2); +console.log(expression3); +console.log(expression4); +console.log(expression5); +console.log(expression6); +console.log(expression7); +