Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 32 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ const s4 = "bread";
const s5 = "and";

// Concatenate the string variables into one new string

const sT = s1 + " " + s2 + " " + s3 + " " + s4 + " " + s5;
console.log(sT);

// Print out the concatenated string


//Fred fed Ted bread and. Ieration 1.1 completed


/*******************************************
Expand All @@ -22,10 +23,12 @@ const part1 = "java";
const part2 = "script";

// Convert the last letter of part1 and part2 to uppercase and concatenate the strings

const cameLtaiL = part1.slice(0, -1) + part1.slice(-1).toUpperCase() + part2.slice(0, -1) + part2.slice(-1).toUpperCase();
console.log(cameLtaiL);

// Print the cameLtaiL-formatted string

//javAscripT. Iteration 1.2 completed



Expand All @@ -35,11 +38,11 @@ const part2 = "script";
const billTotal = 84;

// Calculate the tip (15% of the bill total)

console.log(billTotal * 0.15);

// Print out the tipAmount


//12.6 Iteration 2.1 completed


/*******************************************
Expand All @@ -48,9 +51,18 @@ const billTotal = 84;

// Generate a random integer between 1 and 10 (inclusive)

const randomNumber = Math.floor(Math.random() * 10) + 1;
console.log(randomNumber);


// Print the generated random number

//4
//2
//8
//10
//8
//7
//5. Iteration 2.2 completed


/*******************************************
Expand All @@ -61,16 +73,20 @@ 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 expression1 = a && b; //The "AND" operator
// False

const expression2 = a || b; //The "or" operator, opposite of operator "AND"
// True
const expression3 = !a && b; //The "NOT" (!) operator and the "AND" operator.
// False
const expression4 = !(a && b);
// True
const expression5 = !a || !b;

// True
const expression6 = !(a || b);
// False
const expression7 = a && a;
// True

const expression7 = a && a;
//Iteration 3.1 completed