forked from CodeNextCoaches/te2018grade9term1
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathmath.js
43 lines (31 loc) · 1.15 KB
/
math.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Variables
let num1 = 5;
let num2 = 10;
// **** Problem 1 ****
// Store the sum of num1 and num2 in a variable.
// Print the sum.
let sum = num1 + num2;
console.log(sum);
// **** Problem 2 ****
// Store the difference between sum (above) and 7 in a variable.
// Print the difference.
// **** Problem 3 ****
// Store the product of difference and 3 in a variable.
// Print the product.
// **** Problem 4 ****
// Store the power of the product raised to an exponent of 2 in a variable.
// Print the power.
// **** Problem 5 ****
// Store the quotient of the power divided by 4 in a variable.
// Print the quotient.
// **** Problem 6 ****
// Store the remainder of the quotient divided by 2 in a variable.
// Print the remainder.
// **** Problem 7 ****
// Print a boolean value (true/false) representing if the quotient from
// problem 5 is even or odd. If the quotient is even, print true. If the
// quotient is odd, print false.
//
// Hint: You can tell if a value is even or odd if it is divisible by 2;
// in other words, if there is no remainder after dividing the value by
// 2, then the value is even. See problem 6!