diff --git a/index.js b/index.js index 294f6b2..53fe335 100644 --- a/index.js +++ b/index.js @@ -9,9 +9,11 @@ const s5 = "and"; // Concatenate the string variables into one new string +const tongueTwister = `${s1} ${s2} ${s3} ${s4} ${s5} ${s3} ${s2} ${s1} ${s4}` // Print out the concatenated string +console.log(tongueTwister) @@ -23,9 +25,18 @@ const part2 = "script"; // Convert the last letter of part1 and part2 to uppercase and concatenate the strings +const lasLetter1 = part1[part1.length - 1].toUpperCase() +const lasLetter2 = part2[part2.length - 1].toUpperCase() + +const pair1 = part1.slice(0 , part1.length - 1 ); +const pair2 = part2.slice(0 , part2.length - 1 ); + +const result = `${pair1}${lasLetter1}${pair2}${lasLetter2}` // Print the cameLtaiL-formatted string +console.log(result) + @@ -36,10 +47,12 @@ const billTotal = 84; // Calculate the tip (15% of the bill total) +const tipPor = 0.15; +const tipAmount = billTotal * tipPor; // Print out the tipAmount - +console.log(tipAmount) /******************************************* @@ -48,10 +61,11 @@ const billTotal = 84; // Generate a random integer between 1 and 10 (inclusive) +const number = Math.random() * (10 - 1) + 1; // Print the generated random number - +console.log(Math.round(number)); /******************************************* Iteration 3.1 | Booleans @@ -73,4 +87,12 @@ const expression5 = !a || !b; const expression6 = !(a || b); -const expression7 = a && a; \ No newline at end of file +const expression7 = a && a; + +// 1. false +// 2. true +// 3. false +// 4. true +// 5. true +// 6. false +// 7. true \ No newline at end of file