diff --git a/index.html b/index.html index 53e29ed..3c88aa0 100644 --- a/index.html +++ b/index.html @@ -1,16 +1,16 @@ - +
- - -Open the Dev Tools console to see the console output.
+ + + + - - \ No newline at end of file + diff --git a/index.js b/index.js deleted file mode 100644 index 294f6b2..0000000 --- a/index.js +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************* - Iteration 1.1 | Tongue Twister -*******************************************/ -const s1 = "Fred"; -const s2 = "fed"; -const s3 = "Ted"; -const s4 = "bread"; -const s5 = "and"; - -// Concatenate the string variables into one new string - - -// Print out the concatenated string - - - - -/******************************************* - Iteration 1.2 | Camel Tail -*******************************************/ -const part1 = "java"; -const part2 = "script"; - -// Convert the last letter of part1 and part2 to uppercase and concatenate the strings - - -// Print the cameLtaiL-formatted string - - - - -/******************************************* - Iteration 2.1 | Calculate Tip -*******************************************/ -const billTotal = 84; - -// Calculate the tip (15% of the bill total) - - -// Print out the tipAmount - - - - -/******************************************* - Iteration 2.2 | Generate Random Number -*******************************************/ - -// Generate a random integer between 1 and 10 (inclusive) - - -// Print the generated random number - - - -/******************************************* - Iteration 3.1 | Booleans -*******************************************/ - -const a = true; -const b = false; - -// Try and guess the output of the below expressions first and write your answers down: -const expression1 = a && b; - -const expression2 = a || b; - -const expression3 = !a && b; - -const expression4 = !(a && b); - -const expression5 = !a || !b; - -const expression6 = !(a || b); - -const expression7 = a && a; \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..3be1661 --- /dev/null +++ b/script.js @@ -0,0 +1,63 @@ +// Iteration 1 +const s1 = "Fred"; +const s2 = "fed"; +const s3 = "Ted"; +const s4 = "bread"; +const s5 = "and"; + +const text = `${s1} ${s2} ${s3} ${s5} ${s3} ${s2} ${s1} ${s4}`; +// "Fred fed Ted bread and Ted fed Fred bread". + +console.log(text); + +// Itertation 2 +const part1 = "java"; +const part2 = "script"; + +const part1new = part1.slice(0,-1) + part1.slice(-1).toUpperCase() + +const part2new = part2.slice(0,-1) + part2.slice(-1).toUpperCase() + +const cameLCase = part1new + part2new + +console.log(cameLCase) + +// Itration 3 + +const billTotal = 84; + +const tipAmount = billTotal * 0.15 + +console.log(tipAmount) + +// Iteration 4 +const max = 10 +const randomNumber = Math.floor(Math.random() * max) + +console.log(randomNumber) + +// Iteration 5 +const a = true; +const b = false; + +// Try and guess the output of the below expressions first and write your answers down: +const expression1 = a && b; // false +console.log(expression1) + +const expression2 = a || b; // true +console.log(expression2) + +const expression3 = !a && b; // false +console.log(expression3) + +const expression4 = !(a && b); // true +console.log(expression4) + +const expression5 = !a || !b; // true +console.log(expression5) + +const expression6 = !(a || b); // false +console.log(expression6) + +const expression7 = a && a; // true +console.log(expression7) \ No newline at end of file