Which of the following should be used to make the code snippet work for students who get any score between 0 – 100? var grade = 0; var score = parseInt(“What’s the score?”); if (score < 70) grade = "F"; else if ( ??? ) grade = "C"; else if (grade >= 85) grade = “A”;
Which code snippet is equivalent to: var message = (y == 1…
Which code snippet is equivalent to: var message = (y == 10) ? “correct” : “incorrect”;
What will display after the following code is run if z = 3…
What will display after the following code is run if z = 3? switch(x) { case 1: document.write(“one!”); case 2: document.write(“two!”); case 3: document.write(“three!”); default: document.write(“go!”);
What integer values of y would make the following statement…
What integer values of y would make the following statement true? (y >= 4) || (y < 8)
Given: a = 4 and b = 3, evaluate: (14 % a ) * a * b / 6 +…
Given: a = 4 and b = 3, evaluate: (14 % a ) * a * b / 6 + (b * b)
19. The result of any test condition is always either true…
19. The result of any test condition is always either true or false.
What is the scope of the variable pen on line 6? var pen =…
What is the scope of the variable pen on line 6? var pen = “Bic”; var pencil = “0.7 mm lead”; function writeIt() { document.write(“I have a ” + pen + ” pen.”); pen = “Flair”; document.write(“You have a ” + pen + ” pen.”); var pencil = “0.5mm lead”; document.write(“I prefer pencils with ” + pencil); }
How many elements are in an array created with the following…
How many elements are in an array created with the following loop? var myArray = new Array; for (k = 0; k , 8; k++) myArray = k;
Evaluate 8 % 7
Evaluate 8 % 7
Which would be used to have a JavaScript function named hell…
Which would be used to have a JavaScript function named hello() execute before the user views a web page?