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

Computer Science & Information Technology

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

Computer Science & Information Technology

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?

Computer Science & Information Technology

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.

Computer Science & Information Technology

In the Document Object Model, the root element of the document object is the __________ element.

a. b. c. d. <html></p> </div> <div class="d-flex justify-content-between align-items-center"> <div class="btn-group"> <a href="https://sciemce.com/qa/9JekcP52onqF" class="btn btn-sm btn-dark px-3">View</a> </div> <span class="badge bg-secondary">Computer Science & Information Technology</span> </div> </div> </div> </div> </div> </div> </div> </main> <footer class="text-body-secondary py-4"> <div class="container"> <div class="row"> <div class="col-md-6"> <p class="mb-1 text-center">Sciemce: Your Gateway to Quick, Reliable Answers.</p> </div> <div class="col-md-6"> <p class="mb-1 text-center"> <a href="https://sciemce.com/honor/" class="text-decoration-none">Honor Code</a> | <a href="https://sciemce.com/privacy/" class="text-decoration-none">Privacy Policy</a> </p> </div> </div> </div> </footer> <script src="https://sciemce.com/assets/js/bootstrap.bundle.min.js"></script> </body> </html>