CMSC104 Spring 2010

Exam 2 Sample Questions

True/False Questions

Circle TRUE or FALSE for each of the following questions.

  1. TRUE/FALSE
    int is a reserved word in JavaScript.

  2. TRUE/FALSE
    2doList is a legal identifier in JavaScript.

  3. TRUE/FALSE
    JavaScript programs are interpreted in the browser.

  4. TRUE/FALSE
    If n is an integer, the value of the expression n % 5 is 0 whenever n is a multiple of 5.

  5. TRUE/FALSE
    If n is an integer, the value of the expression n % 7 is 0 whenever n is a not a multiple of 7.

  6. TRUE/FALSE
    If n is an integer, the value of the expression n % 6 is always less than 6.

  7. TRUE/FALSE
    In the JavaScript programing language, variable names can have at most 8 characters.

  8. TRUE/FALSE
    HTML is used to show the meaning of the text on a Web page.

  9. TRUE/FALSE
    CSS allows us to change the presentation of an HTML document.

  10. TRUE/FALSE
    What is the value of the expression 2 * 6 - 5 + 8 % 5

  11. TRUE/FALSE
    What is the value of the expression 3 * 5 - 19 + 7 % 4

  12. TRUE/FALSE
    What is the value of the expression 5 * 5 - 19 - 6 % 7

  13. TRUE/FALSE
    What is the value of the expression 3 * 5 - 12

  14. TRUE/FALSE
    The Internet and the WWW are interchangeable.

  15. TRUE/FALSE
    If the variables a and b are holding the values 5 and 2, respectively, the expression
    a / b produces the result 2.5

  16. TRUE/FALSE
    A Web page is stored inside of the Web browser.

  17. TRUE/FALSE
    The CSS comment delimeters are /* and */.

  18. TRUE/FALSE
    Any code that can be written as a for loop can also be written as a while loop.

  19. TRUE/FALSE
    All variables should be declared and before they are used

  20. TRUE/FALSE
    <p>...</p> is an example of a self closing tag.

  21. TRUE/FALSE
    Each call to document.write() causes printing to start at the beginning of the next line.

  22. TRUE/FALSE
    JavaScript is a client-side scripting language.

  23. TRUE/FALSE
    Displaying text with an alert() has the same effect as displaying text with document.write().


A Feature of ...?

Identify each of the following as a feature of CSS, HTML, JavaScript or none

  1. var
  2. <head>
  3. font-family
  4. alert
  5. text-align
  6. !doctype
  7. parseInt
  8. document.write
  9. RAM
  10. </title>
  11. /* */
  12. if
  13. default
  14. color
  15. for