What is a variable?
A named reference to a value that can be used repeatedly throughout a program.
What is a Conditional Statement?
Affects the sequential flow of control by executing different statements based on the value of a Boolean expression.
What is a Function?
A named group of programming instructions. Also referred to as a “procedure”.
What is a string?
An ordered sequence of characters.
var awesome="2";
is the value of variable awesome a number or a string?
String
What does the variable Likes evaluate to?
var Likes = 0;
Likes = Likes +1;
Likes = 8;
8
What does the logical operator "&&" mean?
And
What would the console.log read if ONLY function summer was ran?
function spring(){
console.log("First comes spring, when flowers bloom");
}
function summer(){
console.log("Summer's sun will follow soon");
}
"Summer's sun will follow soon"
What is a comparison operator?
Ex.
<, >, <=, >=, ==, !=
What would the variable myStory evaluate to?
var myString = "rock";
var myOtherString = "roll";
var myStory = myString + " and " + myOtherString;
myStory = "rock and roll"
What does the variable myFavoriteFood evaluate to?
var myFavoriteNumber;
var myFavoriteFood;
myFavoriteNumber = 2;
myFavoriteFood = "pie";
"pie"
What does the logical operator "||" mean?
Or
What would the console log display fi the button was clicked 3 times?
onEvent("button", "click", function( ) {
birthday();
console.log(" Happy birthday!");
" Happy birthday!"
" Happy birthday!"
" Happy birthday!"
What is a Boolean value?
A data type that is either true or false.
Can I adopt a cat?
I can if I have at least $40 and if I am over 14 years old
money = $46 age=12 years
No!
(2 years too young)
What would the result of this program be?
var myAge = 14;
console.log("Right now I am");
console.log(myAge);
console.log("years old.");
What does the logical operator "!" mean?
Not
Would the program display soldOutLabel? Or be hidden?
tickets = 36
function soldOut() {
if(tickets >= 20){
setProperty("soldOutLabel","hidden",false);
What is a function call?
A command that executes the code within a function.
true && false evaluates to...?
FALSE!
What would variable clicks evaluate to after clicking 7 times?
var clicks = 0;
onEvent("addOneButton", "click", function() {
clicks = clicks + 2;
clicks = 14
Is happiness "High" or "Low"?
happiness = 3;
if (happiness > 5) {
happinessLevel = "High";
} else {
happinessLevel = "Low";
"Low"
True or False?
"Functions are an item that can hold one value at a time"
FALSE!
A combination of operators and values that evaluates to a single value
What does MOD mean?
the remainder that is left after a number is divided by another number