Variables & Constants
Operators & Calculations
Functions & Random Numbers
Conditionals & Program Tracing
Debugging & Program Design
100

This keyword creates a variable whose value can change.

What is let?

100

This operator finds the remainder after division

What is %?

100

This keyword begins a function declaration

What is function?

100

This keyword begins the “otherwise” part of a conditional statement

What is else?

100

Why does firstName + lastName print FlorenceFernandez instead of Florence Fernandez?

No space was included between the two strings.

200

This keyword creates a variable whose value should not change.

What is const?

200

This operator is used for multiplication

What is *?

200

This function call runs a function named main

What is main();?

200

What does this program print? let num = 5; let result = num * num;

What is 25?

200

Write an expression so the name FlorenceFernandez includes a space

Florence + " " + Fernandez

300

Correct this line: let numApples == 20;

let numApples = 20;

300

What is the value of 20 % 3?

What is 2?

300

This naming style uses lowercase words with capital letters between words, such as dayOfWeek

What is camelCase?

300

What does this program print? let score = 75; if (score >= 70) console.log("Pass"); else console.log("Fail");

What is Pass?

300

A store has 20 apples and a customer wants 25. What should the program display?

There are not enough apples.

400

This is the best declaration for a speed limit that will never change: let speedLimit = 65;

const speedLimit = 65;

400

Write code that calculates 120 kilometers traveled in 30 minutes as kilometers per hour

console.log(120 / (30 / 60));

400

If hello(); appears before world(); inside a function, which message prints first?

What is hello?

400

What does this program print? let score = 60; if (score >= 70) console.log("Pass"); else console.log("Fail");

What is Fail?

400

What type of statement should determine whether the customer has requested too many apples?

An if/else statement.

500

Explain the difference between let and const.

let can be reassigned; const cannot be reassigned.

500

Correct this line so it calculates the leftover apples after dividing 20 apples among 3 people. let leftOver = numApples / 3;

let leftOver = numApples % 3;

500

Write code that generates a random integer from 5 through 10, including both numbers

Randomizer.nextInt(5, 11)

500

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.

500

Name two functions an apple store program might use

getPurchaseAmount() and calculateRemainingApples()