solution 100% pass
What is the proper function to call to print to the screen? - Correct Answers println
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! What keyword do you need to use to define a variable in JavaScript? - Correct Answers var
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! What function do you need to call to ask the user of the program to enter text? - Correct Answers
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! readLine
II! println(2 + 2); - Correct Answers 4 II! II! II! II! II! II! II!
II! What symbol do you use to do division in JavaScript? - Correct Answers /
II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! What symbol do you use to do multiplication in JavaScript? - Correct Answers *
II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! In the following code, we create a circle and add it to the screen. What is the meaning of the x variable?
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
var x = 20; II! II! II!
var circle = new Circle(x);
II! II! II! II!
add(circle); - Correct Answers The radius of the circle II! II! II! II! II! II! II! II! II!
II! What are the coordinates of the top right corner of the screen? - Correct Answers getWidth(), 0
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! Which of the following is not a valid value for a boolean? - Correct Answers yes
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! What symbol represents the and operator in JavaScript? - Correct Answers &&
II! II! II! II! II! II! II! II! II! II! II! II!
II! What symbol represents the or operator in JavaScript? - Correct Answers ||
II! II! II! II! II! II! II! II! II! II! II! II!
, II! After the following code runs, what is the value of isWeekend?
II! II! II! II! II! II! II! II! II! II!
var isSaturday = true; II! II! II!
var isSunday = false; II! II! II!
var isWeekend = isSaturday || isSunday; - Correct Answers true
II! II! II! II! II! II! II! II! II! II!
II! What is the proper way to compare if two values are equal in a boolean expression in JavaScript? -
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! Correct Answers == II! II!
II! What is the proper operator for "not equals" in JavaScript? - Correct Answers !=
II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! What kind of statement allows us to run a block code only if a certain condition is true? - Correct Answers
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! if statement
II!
II! What kind of statement allows us to run one block of code if one condition is true, and a separate block of
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! code otherwise? - Correct Answers if/else statement
II! II! II! II! II! II! II!
II! How can we check if a variable num is even? - Correct Answers (num % 2 == 0) will be true
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
II! How many times will the following program print "hello"?
II! II! II! II! II! II! II! II!
for (var i = 0; i < 5; i++) {
II! II! II! II! II! II! II! II! II!
II! println("hello");
} - Correct Answers 5
II! II! II! II! II!
II! In the following code, what will be the last number to print to the screen before the program finishes?
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!
for (var i = 0; i < 10; i++) {
II! II! II! II! II! II! II! II! II!
II! if (i % 2 == 0) {
II! II! II! II! II! II!