Section 3 Answer Key

  1. The array $array = (“One”=>1, “Two”=>2, “Three”=>3) is numeric
    1. True [Incorrect]
    2. False [Correct!]
  2. Which equation equates to 14?
    1. 4 + 5 2 – 4 [10]
    2. (4 + 5) 2 – 4 [Correct!]
    3. 4 + 5 (2 – 4) [-6]
    4. 4 + (5 2) – 4 [10]
  3. The foreach() function in PHP is used when dealing with:
    1. Strings [Incorrect]
    2. Arrays [Correct!]
    3. Objects [Incorrect]
    4. Lists [Incorrect]
  4. Which PHP reserved array holds values passed in the URL?
    1. $_POST [Incorrect]
    2. $_GET [Correct!]
    3. $_SESSION [Incorrect]
    4. None of these [Incorrect]
  5. Which of the following is NOT a valid variable name?
    1. $variable [Incorrect]
    2. $string [Incorrect]
    3. $_string1 [Incorrect]
    4. $and-then [Correct!]
  6. Which of the following is an incorrect definition?
    1. Apache = Web Server [Incorrect]
    2. PHP = Object oriented language [Incorrect]
    3. MySQL = Database Server [Incorrect]
    4. HTML = Operating System [Correct!]
  7. Which of the following PHP functions runs until a condition is met?
    1. foreach() [Incorrect]
    2. while() [Correct!]
    3. during() [Incorrect]
    4. None of these [Incorrect]
  8. Declaring strings using single quotes means PHP syntax in the string will be shown.
    1. True [Correct!]
    2. False [Incorrect]
  9. Which HTML element is used for JavaScript?
    1. <scripting> [Incorrect]
    2. <javascript> [Incorrect]
    3. <jscript> [Incorrect]
    4. <script> [Correct!]
  10. Where can we place JavaScript?
    1. <head> [This is one place]
    2. <body> [This is one place]
    3. A & B [Correct!]
    4. None of these [Incorrect]
  11. JavaScript and Java are the same thing.
    1. True [Incorrect]
    2. False [Correct!]
  12. DOM stands for
    1. Document Object Model [Correct!]
    2. Document Oriented Media [Incorrect]
    3. Document Object Manager [Incorrect]
    4. None of these [Incorrect]
  13. When a user views a page containing a JavaScript program, which machine actually executes the script?
    1. The user’s browser [Correct!]
    2. The Web server [Incorrect]
    3. Both [Incorrect]
    4. None of the above [Incorrect]
  14. Which of the following cannot be done with JavaScript?
    1. Validating a form [Incorrect]
    2. Sending a form’s contents by email [Correct!]
    3. Storing the form’s contents to a database file on the server [Incorrect]
    4. None of the above [Incorrect]
  15. Which of the following is not a valid JavaScript variable name?
    1. 1stname [Correct!]
    2. _firstName [Incorrect]
    3. FirstName [Incorrect]
    4. None of these [Incorrect]
  16. What is the correct JavaScript syntax to write “Hello World”?
    1. System.out.println(“Hello World”) [Incorrect]
    2. println (“Hello World”) [Incorrect]
    3. document.write(“Hello World”) [Correct!]
    4. response.write(“Hello World”) [Incorrect]
  17. jQuery uses CSS selectors to interact with page elements.
    1. True [Correct!]
    2. False [Incorrect]
  18. In jQuery, $(‘div’) would select
    1. The first div element [Incorrect]
    2. All div elements [Correct!]
    3. An element named div [Incorrect]
  19. Which jQuery function makes sure the contained code only runs when the page is done loading?
    1. $(body).onload() [Incorrect]
    2. $(document).loaded() [Incorrect]
    3. $document.ready() [Correct!]
    4. None of these [Incorrect]
  20. jQuery is an add-on library for JavaScript, not an independent language.
    1. True [Correct!]
    2. False [Incorrect]

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Section 3 Answer Key by Michael Mendez is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.