Basic Algebraic Math hacks
Q1 (Exponents):
A cube has a side length of 6 units. What is its volume?
%%js
let side = 6
let volume = (side**3)
console.log(volume)
<IPython.core.display.Javascript object>
Q2 (PEMDAS):
Evaluate the expression:
(7+14)*5/12 + 2
%%js
let num = (7+14)
let product = (num*5)
let quotient = (product/12)
let sum = (quotient+2)
console.log(sum)
<IPython.core.display.Javascript object>
Q3 (Algorithm):
Write JavaScript code where you define variables and run commands that find the values of operations you apply onto them
%%js
let a = 10;
let b = 4;
let c = 3;
let sum = a + b;
let difference = a - b;
let product = a * c;
let quotient = a / b;
let remainder = a % c;
let isGreater = a > b;
let isEqual = b === c;
console.log("a + b =", sum);
console.log("a - b =", difference);
console.log("a * c =", product);
console.log("a / b =", quotient);
console.log("a % c =", remainder);
console.log("Is a > b? ", isGreater);
console.log("Is b === c? ", isEqual);
<IPython.core.display.Javascript object>
Javascript Outputs for all Hacks

