Addition
*
What is the output of the following program:
let firstName = "John";
firstName = "Jack";
console.log(firstName);
Jack
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
Given the following:
let totalCost = 90;
let numBagsOfChips = 30;
How could you print the cost per bag?
console.log(totalCost/ numBagsOfChips);
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? “);
Subtraction
-
What is the output of the following program:
let firstName = “Selena”;
let lastName = “Gomez”;
console.log(firstName + lastName);
SelenaGomez
Which of the following function names follows JavaScript conventions?
a. GetFirstName()
b. Get_First_Name()
c. getFirstName()
d. getfirstname()
C
What does modulus calculate?
The remainder of a division problem
Write a line of code to return a random number between 10 and 20.
Randomizer.nextInt(10, 20)
Multiplication
*
What is the output of the following program:
let firstName = "Taylor";
console.log(firstname);
Syntax error! Variable names do not match.
const PI = 3.14
Where in your program would you place the above line of code to declare a constant?
What is 15%4?
3
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.
Division
/
let firstLine = "Hello";
let secondLine = "World";
console.log(firstLine);
console.log();
console.log(secondLine);
Hello
World
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!]
let numChips = 40;
let numSodas = 70 + numChips;
numChips = 30;
let total = numChips + numSodas;
console.log(total)
140
In Hidden Figures, what did she use in the office that the rest of the employees did not want to touch?
Coffee Pot
Modulus
%
What is the output of the following program:
console.log("20*30")
20*30
What is the convention for capitalization called in JavaScript?
Camel Case
What is the output of the following program:
let stepOne = 30+40;
let stepTwo = stepOne*2;
let stepThree = stepOne + 5;
console.log(stepThree);
75
In Hidden Figures, what was the name of the character who went to court to take classes at a segregated high school?
Mary