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.
- If
x is a double variable, write a simple assertion
that x is greater than zero and less than y.
- 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.
- Write the Java statement that creates a Pattern from the String
"a(.*)b(.*)c(.*)d"
.
- Write the Java statement that creates a Matcher for the String
"abracadabra"
using the Pattern defined in the previous question.
- Using the above Matcher, does
find() succeed? If so,
what is returned by each group(N)
for each legal value of N ?
- 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).
- Name two elements that you should always find within an HTML
<table>
element.
- What HTML would you write to draw a horizontal line across the page?
- What HTML would you write to make the entire background of your document
a bright red?
- Name two HTML tags that are not containers.
- What attribute is required in an
<img ...>
tag?
- List two (and only two) of the ways in which XHTML is stricter than HTML.
- There are three versions of XHTML. Name two (and only two) of them.
- HTML and XML are designed for different purposes. Briefly, what
is the purpose of each?
- HTML:
- XML:
- What organization defines the standards for HTML, XHTML, and XML?
- What does it mean to say that an XML document is valid?
- Briefly tell what each of the following symbols means in a DTD:
+ (plus sign)
* (asterisk)
? (question mark)
| (vertical bar)
, (comma)
- 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.
- Write a short but complete XML document that lists these two cartoon
characters. Don't forget the XML header.
- Write a DTD that describes this document. Make it general enough that
we can add other cartoon characters (of other species) later.