CS174 Spring 2002Practice Midterm 1
The practice midterm is below. Here are some facts about the actual
midterm: (a) The midterm will be in class . (b) It is
closed book, closed notes. Nothing will be permitted on your desk except
your pen (pencil) and test. (c) You should bring photo ID.
(d) There will be more than one version of the test. Each version
will be of comparable difficulty. (e) If your cell-phone or beeper
goes off you will be excused from the test at that point and graded
on what you have done till your excusal. (f) One problem (less typos)
on the actual test will be from the practice test.
1. Give the HTML code to produce an unordered list of four items such
that the first of these items is an ordered list of 3 items.
2. Explain how you could manually connect to www.mathcs.sjsu.edu and GET
the document cool.html.
3. You want to create a three column document with each of the columns in
a different color. Explain how to achieve this effect in HTML.
Use in-line styles.
4. Give the HTML to create a page with 5 frames. 3 on a first row
and 2 on a second row. Each frame should be of a different width.
5. Give the HTML needed to make a link that targets the file
bob.html which lives in the directory one up from the current location.
Make it so this link is a clickable image that uses the image in the
file photo.gif.
6. Explain the following terms and concepts:
(a) XML
(b) static keyword in Java
(c) implements vs. extends in Java
(d) constructor
(e) exception
7. Write a short Java application that assumes its first command line
argument is a list of colon separated last names. under this
assumption it prints each of these last names on a separate line.
Use StringTokenizer.
8. Write a short Java application that stores five name and associated
telephone numbers into a HashMap. The program then looks up the name
Bob in the HashMap and prints out his telephone number to the console.
9. Write a short Java application that store the numbers 1 to 30 in an
object of the concrete class in java.util that implements SortedSet.
It then uses an iterator to print these numbers out.
10.Write a short servlet that generates an HTML page with Yippee! on it
in an h1 header if the parameter bob passed to it has the value happy
and generates a page with Bummer! on it in an h1 header otherwise.
|