forked from coach-stephanie/te2018grade9term1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugging.js
More file actions
40 lines (30 loc) · 717 Bytes
/
debugging.js
File metadata and controls
40 lines (30 loc) · 717 Bytes
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
// Remove block comments when ready to debug a program.
// Program #1: "Careless"
let x = 3;
if(x => 3){
X+++
}
Else if(X == 2){
console.log(x = 2);
}
// Program #2: "Bad logic and math"
let money = READLINE.question("how much money do you have");
if(money > 50 && money <= 20) {
money /= 2;
}
else {
money /= 0;
}
// Program #3: "And what else?"
let num1 = READLINE.question("Enter num1: ");
let num2 = READLINE.question("Enter num2: ");
let num3 = READLINE.question("Enter num3: ");
if(num1 > num2 && num3) {
console.log(`${num1} is the largest value.`);
}
else if(num2 > num3 && num1) {
console.log(`${num2} is the largest value.`);
}
else {
console.log(`${num3} is the largest value.`);
}