Critical Thinking Questions
Case 10-2
?
Roger has joined WebPort Inc. as a junior JavaScript programmer. He is working with a large team of expert programmers to launch a website.
?Roger is writing a code and he has been advised, by his mentor, to provide comments in the code. What is the format that Roger must follow to write comments in JavaScript?
A. ?He must use the slash and asterisk for multiline comments.
B. ?He must use a single slash for a one-line comment.
C. ?He must use double slashes and a period for multiline comments.
D. ?He must use the period and asterisk for a one-line comment.
Answer: A
You might also like to view...
The item marked 2 in the accompanying figure is the wave's ____.
A. amplitude B. frequency C. resolution D. sample rate
Augment your indexes.html page so that in addition to displaying the wind chill index when the user clicks the button, it also displays a health warning message when appropriate. For example, the appearance of the page when the wind chill reaches the Danger category (? -45ยบ).
What will be an ideal response?
Analyze the following code:
``` int main() { int x[5]; int i; for (i = 0; i < 5; i++) x[i] = i; cout << x[i] << " "; } ``` a. The program may have a runtime error because the last statement in the main function has the out of bound index for the array. b. The program displays 4. c. The program has a compile error because i is not defined in the last statement in the main function. d. The program displays 0 1 2 3 4.
In the Document Object Model, the root element of the document object is the __________ element.
a.
b. c.