HTML, CSS, and jQuery
Variables
Conditionals
Arrays and Loops
Functions
100

This symbol is used to select a class in CSS and jQuery.

What is "."?

100

The type of the variable "hello"

What is a string?

100

This is output to the console by console.log(false || true)

What is "true"?

100

Declare an array called "teachers" and include the names of all volunteer teachers in the class.

(answers will vary)

Example:

var teachers =["James","Tasha","Tommy","Angie"]

100

Write a function call to a function called onceUponATime with an argument of “Cinderella”

What is onceUponATime("Cinderella")?

200

These are the four elements of the box model.

What are margin, padding, border, and content?

200

"typeof(3.14)" will return this

What is number?

200

What is printed to the console by console.log((true && false || true) || (true && true || false));

What is "true"?

200

This is printed to the console

var donuts = ["vanilla", "chocolate", "strawberry”];

console.log(donuts.length)

What is 3?

200

List the parameter(s) in the following function.

function greeting(name1, name2){

   $("p").text("Welcome " + name1 + "and " + name2);

}

name1

name2

300

This CSS rule makes it easier to design flexible responsive layout structure for webpages

What is "display:flex"?

300

The value of score in the following code?

var points = 5;

var bonus = 3;

var multiplier = 2;

var score = (points + bonus) * multiplier;

What is 16?

300

Write a conditional statement that checks if a variable called secretNumber is equal to a variable called myGuess.

if(secretNumber===myGuess){

   //do something

} else{

   //do someting else

}

300

How many elements are in the array “donuts” after the following code is run?

var donuts = ["vanilla", "chocolate", "strawberry”];

var faveFlavor = "glazed";

donuts.push(faveFlavor);

What is 4?

300

Declare a function called “triple” that accepts one number as an argument and returns 3 times that value.

function triple(num){

   return num * 3;

}

400

Write a click handler to change the color of a page to aqua when the user clicks on a div with the class of "change".

$(".change").click(function)() {

    $("body").css("background-color", "aqua");

});

400

The value of fullName in the following code:

var firstName = “Stephen”

var lastName = “Curry”

var fullName = lastName + “, “ + firstName

What is "Curry, Stephen"?

400

Write a program takes a number grade and converts it to a letter grade

Example: 90-100 → “A”, 80-89 → “B”, 70-79 → “C”, 60-69 → “D”, else “F”

(answers may vary here)

if (grade >= 90) {
  result = "A";
} else if (grade >= 80) {

  result = "B";

} else if (grade >= 70) {

  result = "C";

} else if (grade >= 60) {

  result = "D";

} else {

  result = "F";

}

400

The index of "vanilla" in the following array:

var donuts = ["vanilla", "chocolate", "strawberry”];

What is 0?

400

Write a function named calculateArea that can calculate the area of a rectangle. It should have two parameters, length and width, and it should return the area of the rectangle.

function calculateArea(length, width) {

    area = length * width;

    return area;

}

500

Write a click handler that changes the text of a p tag with the id of "my-reply" to "Hello" when the user clicks a button.

$("button").click(function(){

    $("#my-reply").text("Hello!");

});

500

Write a click handler that takes user input from a class “userName” and stores it in a variable called “user” when the user clicks a button

("button").click(function(){

    var user = (".userName").val();

});

500

Write a compound conditional statement that checks if myNumber is between 10 and 20 or between 20 and 30. If the number is between 10 and 20, print "in the teens" to the console, if the number is between 20 and 30 print  "in the twenties" to the console.

if(myNumber>10 && myNumber<20){

     console.log("in the teens");

}else if(myNumber>20 && myNumber<30){

     console.log("in the twenties");

}

500

Write a forEach loop that iterates over an array called “photos" and appends them to the page in an image tag in a div with a class of “container"

photos.forEach(function(photo){

 $(".container").append("<img src=" + photo +">");

});

500

Write a function that takes an array as an argument and will print each array element to the body of the HTML page when the function is called.

function printArrayElements(array) {

    array.forEach(function(element){

        $("body").append(element);

    });

}