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
90 changes: 90 additions & 0 deletions KishonStClair.js.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Get Even
//1
for ( i=2 ; i<201 ; i+=2 ) {
console.log(i);
}

Question 2
//
for (var i= 0; i <= 10; i++) {
console.log("Love me, pet me! HSSSSSS!");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you try part 2 to this problem?













THERMOSTAT

let currentTemp = Math.floor(Math.random() * 100);
let desiredTemp = 69;
if(currentTemp <= !25 && desiredTemp > 68){
console.log("The temperature is " + currentTemp);
// condition for the temperature under 45f
} else if(currentTemp < !45 +25 && desiredTemp > 68){
console.log("The current temperature is now " + currentTemp);
// condition for the temperature over 75f
} else if(currentTemp > !75 -15 && desiredTemp > 68) {
console.log("Its a little hot in here " + currentTemp);
}





Fizz Buzz

for (var i = 1; <= 100 i++){
if(i % 15 === 0) console.log("FizzBuzz");
else if (i % 3 === 0) console.log("Fizz");
else if (i % 5 === 0) console.log("Buzz");
else console.log(i)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works, but it's important to use those curly brackets after your if (condition) and else if (condition).

also, when I ran this, I got an error in line 44. see if you can figure out what it is!




Bonus


var phoneBook = {
"Abe": "111-111-1111",
"Bob": "222-222-2222",
"Cam": "333-333-3333",
"Dan": "444-444-4444",
"Ern": "555-555-5555",
"Fry": "111-111-1111",
"Gil": "222-222-2222",
"Hal": "333-333-3333",
"Ike": "444-444-4444",
"Jim": "555-555-5555",
"Kip": "111-111-1111",
"Liv": "222-222-2222",
"Mia": "333-333-3333",
"Nik": "444-444-4444",
"Oli": "555-555-5555",
"Pam": "111-111-1111",
"Qiq": "222-222-2222",
"Rob": "333-333-3333",
"Stu": "444-444-4444",
"Tad": "555-555-5555",
"Uwe": "111-111-1111",
"Val": "222-222-2222",
"Wil": "333-333-3333",
"Xiu": "444-444-4444",
"Yam": "555-555-5555",
"Zed": "111-111-1111"
}

for(var number in phoneBook){
if(phoneBook[number] === "333-333-3333"){
console.log(number)
}

}