Symbols
Program Outputs
JavaScript Conventions
Math Calculations
Miscellaneous
100

Addition

*

100

What is the output of the following program:

let firstName = "John";

firstName = "Jack";

console.log(firstName);

Jack

100
  1. Which of the following is a proper variable name (i.e. following JavaScript conventions)?
    a. date_of_birth
    b. dateOfBirth
    c. Date of Birth
    d. DateOfBirth

B

100

Given the following:

    let totalCost = 90;

    let numBagsOfChips = 30;

How could you print the cost per bag?

console.log(totalCost/ numBagsOfChips);

100
  1. You want to ask the user how many bags of chips they would like to buy. How would you read in a number from the user?
    a. let bagsOfChips = console.log(“How many bags of chips would you like? “);
    b. let bagsOfChips = readLine(“How many bags of chips would you like? “);
    c. let bagsOfChips = readInt(“How many bags of chips would you like? “);
    d. let bagsOfChips = nextInt(“How many bags of chips would you like? “);

C
200

Subtraction

-

200

What is the output of the following program:

    let firstName = “Selena”;

    let lastName = “Gomez”;

    console.log(firstName + lastName);

SelenaGomez

200
  1. Which of the following function names follows JavaScript conventions?
    a. GetFirstName()
    b. Get_First_Name()
    c. getFirstName()
    d. getfirstname()

C

200

What does modulus calculate?

The remainder of a division problem

200

Write a line of code to return a random number between 10 and 20.

Randomizer.nextInt(10, 20)

300

Multiplication

*

300

What is the output of the following program:

let firstName = "Taylor";

console.log(firstname);

Syntax error! Variable names do not match.

300

const PI = 3.14

Where in your program would you place the above line of code to declare a constant?

Above the main function, outside of any functions
300

What is 15%4?

3

300

What are the roles in pair-programming and what does each role do?

Driver: to control the mouse and keyboard, and type out the code.

Navigator: to read the problem and narrate the plan of action. Also, to review the Driver's code in order to catch any bugs.

400

Division

/

400
What is the output of the following program:

let firstLine = "Hello";

let secondLine = "World";

console.log(firstLine);

console.log();

console.log(secondLine);

Hello


World

400

What are all of the valid Randomizer functions?

Randomizer.nextInt();

Randomizer.nextBoolean();

Randomizer.nextFloat();

Randomizer.nextColor(); [it's okay if you don't know this one!]

400

let numChips = 40;

let numSodas = 70 + numChips;

numChips = 30;

let total = numChips + numSodas;

console.log(total)


140

400

In Hidden Figures, what did she use in the office that the rest of the employees did not want to touch?

Coffee Pot

500

Modulus

%

500

What is the output of the following program:

console.log("20*30")

20*30

500

What is the convention for capitalization called in JavaScript?

Camel Case

500

What is the output of the following program:

let stepOne = 30+40;

let stepTwo = stepOne*2;

let stepThree = stepOne + 5;

console.log(stepThree);

75

500

In Hidden Figures, what was the name of the character who went to court to take classes at a segregated high school?

Mary

M
e
n
u