Variables
Conditionals
Functions
Miscellaneous
100

Var fizz;

Var bop;

Bop = 10;

Fizz = 20;

Bop = bop + 30; 

Fizz = bop;

console.log(bop + fizz)

What's the output?

80

100

What is a conditional statement?

-Affects the sequential flow of control by executing different statements based on the value of a Boolean expression.

100

Which of the following is true of functions?

 A.   Programs written with functions run more quickly

 B.   Functions can help remove repeated code from a program

 C.   Replacing repeated code with a function will reduce the number of commands the computer needs to run

 D.   Functions are called once but can be declared many times

B.

100

On July 20, 1969, Neil Armstrong became the first person in history to do what?

Walk on the moon

200

Var oop;

oop = 10;

oop = oop + 10; 

oop = oop + 5; 

oop = oop + 7; 

console.log(oop); 

What's the output?

32

200

Var score = 50;

Score = score * 10; 

Score = score + 100; 

Score = score - 500; 

If (score < 100){ 

console.log(“less than 100”);

}

Else if (score < 200){ 

console.log(“less than 200”);

}

Else if (score < 300{ 

Console.log (“less than 300”);

}

Else{ 

console.log(“300 or more”)

}

What's the output?

“less than 200”

200
Provide an example of a function call with correct syntax

pizza();

200

Which NBA team plays its home games at Madison Square Garden?

New York Knicks
300

Var cantrell;

Var pizza;

cantrell = 20;

pizza = 100;

cantrell = pizza + 5; 

pizza = cantrell + 8;

console.log(pizza); 

What's the output?

113

300

Var age = 20;

Var day = Saturday;

if(age > 15)  && (day == “Friday”)) {

console.log(“Output A”);

}

Else if ((age > 15) || (day == “Friday”)){ 

console.log(“Output B”); 

}

Else if ((age < 15) && (day == “Sunday”)){

console.log(“Output C”);

}

Else if ((age < 15) || (day == “Sunday”)){

console.log(“Output D”);

}

Else{

console.log(“Output E”);

}

What's the output?

Output B

300

What is the output?


console.log(“CSP”);

letters(); 

letters(); 

letters();

Function letters(){

console.log(“b”);

console.log(“c”);

}

CSP bcbcbc

300

What's the name of the pig in the book “Charlotte's Web”?

Wilbur

400

“Hello” never displays. Which line of code is responsible for this error? 

What is the error?


Var score = 2; 

onEvent(“button1”, “click”, function (){

Var score = 0;

If (score > 5){

setText(“display”, “Hello”);

score++;

}

});

Var score = 0, you don't want to declare the variable score twice, also resetting it to 0 each time will make it impossible to exceed 5

400

Var age = 2;

Var day = "Sunday";

if(age > 15)  && (day == “Friday”)) {

console.log(“Output A”);

}

Else if ((age > 15) || (day == “Friday”)){ 

console.log(“Output B”); 

}

Else if ((age < 15) && (day == “Sunday”)){

console.log(“Output C”);

}

Else if ((age < 15) || (day == “Sunday”)){

console.log(“Output D”);

}

Else{

console.log(“Output E”);

}

What's the output?

Output C

400

What is the difference between a function definition and a function call?

A function call allows you to use the function, a function definition has the body of code that creates the function

400

Pommes frites is the French term for what popular American side dish?

French Fries

500

What are at least 3 rules for creating variables in Javascript?

Answers May Vary,

You can't have spaces, you can't start with a number, you should CamelCase if there's multiple words, Other answers may be acceptable

500

What is the correct conditional statement to check to see if a variable called n is an even number?

if (n % 2 == 0){

console.log("it is an even number")

}

500

var count = 0;

function increment() {

  count = count + 2;

  console.log("Count is now: " + count);

}

increment();

increment();

console.log("Final count: " + count);


What is printed?

Count is now: 2

Count is now: 4

Final count: 4

500

Originally, Amazon only sold what kind of product?

Books