CIT597 Quiz 1
Fall, 2002
Name_________________________________________

Please keep all answers short and to the point. Read each question and answer it; don't add information that wasn't asked for.

  1. If x is a double variable, write a simple assertion that x is greater than zero and less than y.


  2. Write the same assertion as in the previous question, but this time include the values of x and y in the detail message of the AssertionError that may be thrown.


  3. Write the Java statement that creates a Pattern from the String "a(.*)b(.*)c(.*)d" .


  4. Write the Java statement that creates a Matcher for the String "abracadabra" using the Pattern defined in the previous question.


  5. Using the above Matcher, does find() succeed? If so, what is returned by each group(N) for each legal value of N ?




  6. Write a regular expression that will succeed (using find()) on the string "abracadabra" and will return everything between the two r's in group(1).


  7. Name two elements that you should always find within an HTML <table> element.


  8. What HTML would you write to draw a horizontal line across the page?


  9. What HTML would you write to make the entire background of your document a bright red?


  10. Name two HTML tags that are not containers.



  11. What attribute is required in an <img ...> tag?


  12. List two (and only two) of the ways in which XHTML is stricter than HTML.




  13. There are three versions of XHTML. Name two (and only two) of them.


  14. HTML and XML are designed for different purposes. Briefly, what is the purpose of each?
    1. HTML:

    2. XML:

  15. What organization defines the standards for HTML, XHTML, and XML?


  16. What does it mean to say that an XML document is valid?


  17. Briefly tell what each of the following symbols means in a DTD:
    1. + (plus sign)

    2. * (asterisk)

    3. ? (question mark)

    4. | (vertical bar)

    5. , (comma)

  18. Suppose an XML document consists of just a list of cartoon characters. Each character has a name and a species, for instance, Sylvester is a cat; Tweety is a bird.

    1. Write a short but complete XML document that lists these two cartoon characters. Don't forget the XML header.









    2. Write a DTD that describes this document. Make it general enough that we can add other cartoon characters (of other species) later.