CS174 Fall 2006Practice Midterm 1

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test.

[Student generated midterm solutions-PDF]

1. Define and give an example of the following terms: fully qualified domain name, document root, server root.

2. Briefly explain the way MIME types are specified and give some examples of common MIME types

3. Write a short web page using only XHTML (no Javascript or anything else) which after 5 seconds refreshes to the page http://somewhere.com

4. Write an example XHTML 1.1 paragraph with the words red, green, blue in it and such that when you hover over red the tooltip say "blue", but this does not happen if you hover over green or blue.

5. Suppose you wanted to create a histogram in XHTML where the background to the chart was blue and the bars were in green. Explain with a code fragment how to do this with tables and not using images.

6. Explain how form data is transmitted when the GET method is used.

7. Write a short XHTML page with a form to collect a phone number. On your page have a Javascript which check that the number was written in the format (\d\d\d) \d\d\d-\d\d\d\d . If it doesn't it changes the style of the label for the text field so that it is colored red. (I just noticed this solution pops up an alert, you could just change the style of the text element setting its value to be the string "{color:red}" to correct it so that it follows the problem.)

8. Briefly describe the box model for block elements in XML and XHTML.

9. Give an example of defining a new type of object in Javascript and adding a method to it.

10. Give XHTML and CSS examples to show how absolute and relative positioning works.