Questions Attempted? Marks: 1 Semester Examinations CITS1231 Web Technologies 2009
Questions Attempted? Marks: 1 Semester Examinations CITS1231 Web Technologies 2009
Please find the HTML and CSS Reference Cards at the back of this exam
paper (P20-P27).
Please do not tear out any pages from this exam paper.
Section A:
(Q1-Q20)
Section B:
(Q21-Q30)
Section C:
(Q31)
Section C:
(Q32)
Identify the letter of the choice that best completes the statement or answers the question.
Make sure you mark the answers on the separate Multiple Choice Answer Sheet provided.
This will be marked automatically by a computer program.
Marks will not be allocated if you answer the multiple choice questions here.
1. Given a file structure in the figure below, which of the following is the correct relative pathname to
index.html from part1.html?
http://www.csse.uwa.edu.au/cits1231/
tutorial index.html
part1.html
A. __/tutorial/index.html
B. /tutorial/index.html
C. ../index.html
D. ./index.html
2. Referring to the same figure above, what’s the absolute URL for part1.html?
A. http://www.csse.uwa.edu.au/cits1231/part1.html
B. http://www.csse.uwa.edu.au/cits1231/tutorial/part1.html
C. http://www.csse.uwa.edu.au/cits1231/tutorial/Part1.html
D. http://www.csse.uwa.edu.au/cits1231/Part1.html
A. MPEG
B. AVI
C. RealVideo
D. QuickTime
5. To control the size of a digital audio file, you can manipulate the ____.
A. frame rate
B. sampling resolution
C. sound wave’s amplitude
D. value of the width and the height attribute of the <embed> element
6. Given a For loop counter of for (var i = 1; i <= 5; i+=2) , the counter values are ____.
A. 1 and 3
B. 1, 3, and 5
C. 5, 3, and 1
D. 1, 2, 3, 4 and 5
7. Which of the following is not a legal JavaScript statement for accessing objects?
A. document.images[1].src="exam.gif";
B. document.myform.mytextbox.value = “myname”;
C. document.getElementsByID[“myID”] .src="exam.gif";
D. document.p[1]="text for my first paragraph";
8. Among the following types of style rules, ____ has the highest priority.
9. Which of the following sets a width of 150 pixels to the <title> element from any namespace?
10. Which of the following statements about XML, HTML and SGML is not true?
A. XML is an extensible mark language more flexible and powerful than HTML.
B. SGML is not as popular as XML because it is too complex.
C. XML can be used to define XHTML.
D. XML is a language extended on XHTML with namespace.
11. What type of image would you choose to show the sketch of a house’s floor plan on the Web?
A. JPEG
B. GIF
C. MPEG
D. Image Map
A. 216
B. 255
C. 256
D. 1024
13. Which of the following HTML code will affect the vertical alignment of the table content?
A. Embedded media is preferable to linked media because they give the user a choice of
play or stop the media.
B. Linked media is faster to download.
C. You can control the embedded media’s size using height and width, but not with
linked media as hyperlinks <a> does not allow height and width attributes.
D. Linked media is not downloaded when the web page is loaded.
16. URLs can be used in many different situations to address a Web resource, which of the following is not a
valid situation?
A. A URL can be used in an <img> element to indicate where the image should come
from.
B. A URL can be used in the <form> element to indicate the program used to process the
form data.
C. A URL can be used in the <link> element to connect to an external style sheet.
D. A URL can be used in the <title> element to connect this document to a relevant
document.
17. Which of the following statements about the <a> tag is true?
A. Specifying an internal section of a Web page only requires an anchor element with a
name attribute.
B. By default, an anchor element always produces a hyperlink.
C. The only valid attribute for an anchor element is href.
D. Anchor elements can only be used in the navigation bar of a Web page.
18. In CSS, you can override precedence rules by adding the ____ property to a style declaration.
A. !override
B. !main
C. !important
D. !priority
19. The style rule li, em {color: blue} indicates the content of ____ will appear in blue colour.
20. The ____ protocol does not support error checking but is suitable for streaming media.
A. FTP
B. HTTP
C. TCP
D. UDP
22. Explain how client-side form validation is different from server-side form validation? What benefits does
each bring?
23. List two problems of using HTML as a design language. What’s the general solution? How does the
solution solve the two problems you listed?
25. When you would use a linear site structure in preference to a hierarchical one? How would you implement a
linear structure?
26. Write a JavaScript function that calculates the number of days left till the Christmas Date.
27. Explain the relationship between a Document Tree and how a contextual selector like p em {color:red}
works.
28. Describe the situations of using External Style Sheets, Embedded Style Sheets and Inline Styles. Use both
CSS and HTML code to explain how to use each type of the styles.
29. Explain the use of each of the following: URI, URL, and URN.
30. Discuss why a namespace is important? How to declare and use a name space?
<parts>
<message>
<![CDATA[
Parts for printers
]]>
</message>
<part id="chx201">
<title>Chassis and Roller Kit</title>
<description>PR205 chassis and rollers</description>
<instock>512</instock>
</part>
<part id="fa100-5">
<title>Fuser Assembly</title>
<description>Fuser assembly/JE series</description>
<instock>1253</instock>
</part>
<part id="eng005-2">
<title>Engine Kit</title>
<description>Printer engine kit/JE series</description>
<instock>3895</instock>
</part>
</parts>
1) Write a style sheet parts.css to produce a page layout like in the screen shot below;
(10 marks)
32. (20 marks) Write a complete HTML document and an external style sheet that meets the following
requirements and produces a Web page that looks like the screenshot below.
The page is entitled “Places to go around Perth” and stored in a file called places.html. The page uses Arial
or Sans Serif font. It contains 3 sections as indicated in the screenshot:
1. The Header Section: starts at (0px, 0px) and has a dimension of 900px x 264px (width x height).
This section consists of a logo (logo.gif) stored in a folder called images, which is in the same
directory as this places.html page. This section also has the slogan “Welcome to Perth” placed on
top of the logo image. The slogan text is using a fantasy font.
2. The Navigation Section: has a dimension of 150px x 300px (width x height). This section
contains a group of links, which each links to home.html, things.html, places.html (this page),
getAround.html and contact.html, respectively. The two links (King’s Park and Margaret River)
under Places to Go are linking to the relevant internal sections of this page. You will need to work
out the starting position of this section based on the size of the logo.
3. The Content Section: has a width of 750px, and a variable height. This section contains two
topics, the topic headings are in H1 format. The first topic on Kings Park contains paragraph, the
second topic on Margaret River Region contains a form that is formatted using a table. The
options for the selection box of the form are WA, Other Australian States and Overseas. The
form data is to be processed by tour.php in the same folder as this file on the sever side. Make sure
the form data is not appended to the URL when sent.
Heade
r
Naviga-
tion Sec-
tion
Internal-
Naviga- Content
tion
Note that all the coordinates given are in the (x, y) format, that is, x pixels to the right from the left edge of
the browser content area, and y pixels down from the top edge of the browser content area.
Note that all hyperlinks on the page have no underlines (hint: the style rule to remove underline is {text-
decoration: none}, a link has yellow colour on a blue background, a visited link has gray colour on black
background, and a link with mouse hovering on it has a yellow colour on a black background.
Note also the left border of the content area and the borders of the table used for collecting form data.
(20 marks)