COMP 101 Exam 1
Thursday, 30September 2010
Name ______
This is a 75 minute, 75 point test. The point values are listed on each question. The test was designed to be completed in an hour and I am not looking for long answers. You do not get additional credit for writing down everything that you can think of. Indeed, I reserve the right to deduct points for blatant abuse of irrelevant discussions. You should have enough time to think through answers before writing.
If you have any questions, ASK.
The test is open note, open book and open computer…just not open people.
You are to take this test electronically and submit it on Blackboard. The test is on the class home page ( and on Blackboard in docx, doc and odt form. Answers or information about where I can find the answer must be in-line with the question. If you want to submit another document with some of the answers you may, but you MUST point me to their location. If you do that, be sure to upload the additional document(s) to Blackboard as well.
By submitting the exam, you are pledging that you have neither given nor received any unauthorized help on the exam.
Good luck!
Grading [for professor use only]
Question / Value / Grade / Comments1 / 3
2 / 5
3 / 3
4 / 10
5 / 2
6 / 15
7 / 5
8 / 2
9 / 20
10 / 3
11 / 3
12 / 4
TOTAL / 75
File structures
1. (3 points) When you are creating a web site with multiple pages, an external style sheet, pictures and a common header file, which files do you typically put in the same folder?
2. (5 points) When all of the items are in the same folder, how do you reference them in the html? If they are not in the same folder, how do you reference them? If you were to put all of the pictures in a subfolder, how would you reference them?
Broken links
Your roommate is building a website and puts it up on the UNC server. It looks great on their laptop, but when you look at it from your laptop, the pictures appear as broken links.
3. (3 points) What is the most likely cause of the problem?
4. (10 points) Briefly explain the cause of the problem to your roommate, whom we will assume is not in this class.
PHP and CSS
For the next 4 questions, look at the website at
5. (2 points) Is this site using any php? How can you tell?
6. (15 points) Identify parts of the website that might be put into separate php files. Specifically, show the HTML that you would put into the separate file. You do not need to reformat the code or fix anything about it. Also write the php statement that you would use to incorporate it into the web site.
7. (5 points) Why did you select those parts of the page?
8. (2 points) Is this site using an external style sheet? How can you tell?
9. (20 points) Rewrite the following snippet from the website with an external style sheet and appropriately formatted html.
<table border="0" cellspacing="5" cellpadding="3" width="700" align="center" style="background-color: white;">
tr<td style="background-color: white"<imgsrc="images/RegGive.jpg" width="200" height="110" alt="" border="0" /</td>
<td style="background-color: #B0C4DE;" width="500">
<h1 style="font-size:28px;color:#191970;font-weight:700;margin:0;">
22nd Annual Carolina Blood Drive</h1>
<h2 style="font-size: 22px;color: Maroon;font-weight: 700;margin: 0;padding-bottom:5px;">
June 8th at the Dean E. Smith Center </h2>
<h3 style="font-size:18px;color:#369;font-weight:700;margin:0;padding-bottom:5px;border-bottom:1px dotted #0000FF;">7:00 a.m. - 6:00 p.m.</h3</td</tr
</table
Colors
10. (3 points) You find a reference to the color #CBD1F2. What does that mean and how can you find out what color it is?
11. (3 points) Explain, in your own words, why #FFFFFF represents white, and why #000000 represents black.
12. (4 points) There are three ways that you can define a color. For example, any of the following statements are valid in css:
color: red;
color: rgb(255,0,0);
color: #FF0000;
Explain why are they equivalent.