Scripting Languages Final Exam

  1. This exam is due Monday, December 7 at 5pm.
  2. Please complete it using a word processor or ascii text editor. Print out your answers and either:
    1. place it in my mailbox in Claxton 203, or
    2. give it to the receptionist in Claxton 203
  3. You may be surprised by the format of this exam because it involves no coding. I figure that you got that experience doing the homework problems. In this exam I want to know if you have mastered the higher level concepts about scripting languages, if you understand when it is appropriate to use each one, and if you understand the tradeoffs between conventional languages and scripting languages. Hence the essay and fill in the blank problems.
  4. Unless otherwise noted, limit your answers to essay questions to no more than 4 sentences. Do not try to circumvent this limit by using long, rambling sentences. More credit will be given to crisp, well reasoned answers.

  1. (15 points): Fill in the blanks for the following questions:

    1. _____________________ The object model in Javascript is not called a class-instance model but is instead called what?

    2. _____________________ If you simply need to make a single pass through an XML document to convert the tags from one set of names to a different set of names, which XML parser should you use?

    3. _____________________ Which PHP XML parser allows you to accomplish 80% of what you want to do with 20% of the effort?

    4. _____________________ Which language, among the languages we discussed in this course, allows you to dynamically add new properties or methods to an object?

    5. _____________________ What XML tool allows you to specify both the structure of an XML document and the data types of elements in that XML document?

  2. (20 points) Choose the best answer from the following set of choices:

    compiled language, like CHTMLCSS
    DTDSchemaRegular Expressions

    1. _____________ The query language for XML.
    2. _____________ The best language to use for client-side scripting.
    3. _____________ The best language to use for computationally intensive problems.
    4. _____________ The best and simplest language for specifying the structure of a web page.
    5. _____________ The language to use for specifying the appearance of a web page.
    6. _____________ The most modern language for perform server-side scripting.
    7. _____________ The language best used for marking up the data content of a document.
    8. _____________ The language best used to store your data when your data is well organized into a consistent set of fields and efficiency is of the essence.
    9. _____________ The language that along with TCL ushered in the era of scripting languages. Also known for its report extraction capabilities via regular expressions.
    10. _____________ A compact notation that allows you to easily specify type checking expressions for data.

  3. (5 points) In three sentences or less, explain the importance of AJAX to web scripting (please do not tell me what the acronymn stands for).

  4. (12 points) Early in the semester we discussed a number of features of scripting languages that allow programmers to more rapidly develop and debug code than with corresponding conventional languages. List 4 of these features, and for each one describe how it makes program development more efficient.

  5. (8 points): Why does a language like Javascript allow the case branches of switch statements to contain numbers, strings, and variables, while a compiled language like C allows only integers?

  6. (5 points): What makes PHP a better language than Perl for creating dynamic web pages?

  7. (15 points): This question has two parts:

    1. Describe two client-side and two server-side solutions to keeping session information using PHP, and describe the advantages of each. Use no more than three sentences for each solution.

    2. Is it better to keep session information on the client-side or the server-side? Why?

  8. (10 points): Describe what advantages XML has over a database and what advantages a database has over XML.

  9. (10 points): This question has three parts:

    1. What are the advantages of using cascading style sheets to create the appearance and page layout of a web document over specifying the appearance in each html document?

    2. Are cascading style sheets better at specifying the visual appearance of a web document or the page layout of a web document? Justify your answer.

    3. What element in HTML is often used to perform page layout and may well be superior to anything that CSS offers?