This keyword creates a variable whose value can change.
What is let?
This operator finds the remainder after division
What is %?
This keyword begins a function declaration
What is function?
This keyword begins the “otherwise” part of a conditional statement
What is else?
Why does firstName + lastName print FlorenceFernandez instead of Florence Fernandez?
No space was included between the two strings.
This keyword creates a variable whose value should not change.
What is const?
This operator is used for multiplication
What is *?
This function call runs a function named main
What is main();?
What does this program print? let num = 5; let result = num * num;
What is 25?
Write an expression so the name FlorenceFernandez includes a space
Florence + " " + Fernandez
Correct this line: let numApples == 20;
let numApples = 20;
What is the value of 20 % 3?
What is 2?
This naming style uses lowercase words with capital letters between words, such as dayOfWeek
What is camelCase?
What does this program print? let score = 75; if (score >= 70) console.log("Pass"); else console.log("Fail");
What is Pass?
A store has 20 apples and a customer wants 25. What should the program display?
There are not enough apples.
This is the best declaration for a speed limit that will never change: let speedLimit = 65;
const speedLimit = 65;
Write code that calculates 120 kilometers traveled in 30 minutes as kilometers per hour
console.log(120 / (30 / 60));
If hello(); appears before world(); inside a function, which message prints first?
What is hello?
What does this program print? let score = 60; if (score >= 70) console.log("Pass"); else console.log("Fail");
What is Fail?
What type of statement should determine whether the customer has requested too many apples?
An if/else statement.
Explain the difference between let and const.
let can be reassigned; const cannot be reassigned.
Correct this line so it calculates the leftover apples after dividing 20 apples among 3 people. let leftOver = numApples / 3;
let leftOver = numApples % 3;
Write code that generates a random integer from 5 through 10, including both numbers
Randomizer.nextInt(5, 11)
Explain why changing the score from 75 to 65 changes the output.
The value is compared to 70, so the program chooses a different branch of the if/else statement.
Name two functions an apple store program might use
getPurchaseAmount() and calculateRemainingApples()