Docsity

XHTML and File System Trees: Identifying Applicable Items, Exams of Web Programming and Technologies

Toggle sidebar
bg1
Perfect Student Midterm Exam October 28, 2008
Student ID: 0000 Exam: 9379 CS-081/Vickery Page 1 of 5
NOTE: It is my policy to give a failing grade in the course to any student who either gives or receives
aid on any exam or quiz.
INSTRUCTIONS: For multiple choice questions, circle the letter of the one best choice for each
question. There is no penalty for guessing. For other questions, follow the directions in the
question.
1. We have discussed two kinds of โ€œtreesโ€ in this course: File System trees where nodes are
directories and files, and Document Object Model (DOM) trees where nodes are elements of an
(X)HTML document. For each of the following items, check the appropriate boxes to indicate
whether the item applies to File System trees, DOM trees, both, or neither.
Item๎˜ƒFile๎˜ƒSystem DOM๎˜ƒ
The root element is a directory.
The root element is html.
Each element other than the root is the child of another element.
Child elements can be either files or directories.
The root element must have exactly two children: head and body.
Examples of attributes an element can have are class and id.
The parent of the current node can be referenced as โ€œ..โ€
The current node can be referenced as โ€œ.โ€
A parent node can have multiple child nodes.
A child node can have multiple parent nodes.
Parent nodes have to be directories.
2. File names are case sensitive.
A. Always
B. Never
C. It depends on the operating system.
3. What would
~student mean in a URL?
A. Display a web page that was not written by a student.
B. The computer that has the web page is named student.
C. The web page is in a directory that belongs to a user named student.
D. The web page contains information about students.
E. There is a mistake: the character ~ cannot appear in a URL.
4. A web site can have more than one file named index.xhtml.
A. True, as long as each one is in a different directory.
B. False, there can be no more than one file with this name in a web site.
C. True, there can be as many files with this name, even if they are in the same directory.
D. False, index.xhtml is not a valid file name.
E. True, but they must all have exactly the same contents.
5. What is special about the file name index.xhtml in a web site?
A. If a URL ends with the name of a directory, the web server will automatically use the file
named index.xhtml in that directory if it exists.
B. It is a special name because it does not matter how it is capitalized, whereas other file names
are case sensitive.
C. It is the only file name that can have four characters after the dot.
D. It lets the browser know that the web page was written by a professional web developer.
E. It proves that the web page has passed the XHTML and CSS validation tests.
pf3
pf4
pf5

Partial preview of the text

Download XHTML and File System Trees: Identifying Applicable Items and more Exams Web Programming and Technologies in PDF only on Docsity!

Perfect Student Midterm Exam October 28, 2008

Student ID: 0000 Exam: 9379 CS-081/Vickery Page 1 of 5

NOTE: It is my policy to give a failing grade in the course to any student who either gives or receives aid on any exam or quiz.

INSTRUCTIONS: For multiple choice questions, circle the letter of the one best choice for each question****. There is no penalty for guessing. For other questions, follow the directions in the question.

  1. We have discussed two kinds of โ€œtreesโ€ in this course: File System trees where nodes are directories and files, and Document Object Model (DOM) trees where nodes are elements of an (X)HTML document. For each of the following items, check the appropriate boxes to indicate whether the item applies to File System trees, DOM trees, both, or neither. Item File System DOM The root element is a directory. The root element is html. Each element other than the root is the child of another element. Child elements can be either files or directories. The root element must have exactly two children: head and body. Examples of attributes an element can have are class and id. The parent of the current node can be referenced as โ€œ..โ€ The current node can be referenced as โ€œ.โ€ A parent node can have multiple child nodes. A child node can have multiple parent nodes. Parent nodes have to be directories.
  2. File names are case sensitive. A. Always B. Never C. It depends on the operating system.
  3. What would ~student mean in a URL? A. Display a web page that was not written by a student. B. The computer that has the web page is named student. C. The web page is in a directory that belongs to a user named student. D. The web page contains information about students. E. There is a mistake: the character ~ cannot appear in a URL.
  4. A web site can have more than one file named index.xhtml. A. True, as long as each one is in a different directory. B. False, there can be no more than one file with this name in a web site. C. True, there can be as many files with this name, even if they are in the same directory. D. False, index.xhtml is not a valid file name. E. True, but they must all have exactly the same contents.
  5. What is special about the file name index.xhtml in a web site? A. If a URL ends with the name of a directory, the web server will automatically use the file named index.xhtml in that directory if it exists. B. It is a special name because it does not matter how it is capitalized, whereas other file names are case sensitive. C. It is the only file name that can have four characters after the dot. D. It lets the browser know that the web page was written by a professional web developer. E. It proves that the web page has passed the XHTML and CSS validation tests.

Exam ID: 9379 CS-081/Vickery Page 2 of 5

  1. What is the complete pathname of the file referenced in this URL: http://cherry.cs.qc.cuny.edu/a_page.xhtml (Cherry is one of the computers in our lab.) A. C:\My Documents\My Website\a_page.xhtml B. C:\Documents and Settings\My Documents\My Website\a_page.xhtml C. C:\htdocs\a_page.xhtml D. Maple:\My Documents\My Website\a_page.xhtml E. Maple:\My Documents\My Website\index.xhtml
  2. Apache is the name of: A. A computer. B. A web site. C. A web browser. D. A web server. E. A stylesheet.
  3. In XHTML, tag names and attribute names have to be lowercase. A. True B. False
  4. In XHTML, attributes must be inside the starting tag of an element. A. True B. False
  5. In XHTML, all elements must have both a starting tag and a separate closing tag. A. False, the starting tag may be a self-closing tag. B. False, the starting tag may be omitted. C. False, the ending tag may be omitted. D. False, elements and tags have nothing to do with each other in XHTML. E. True.
  6. What is the correct syntax for the value part of an XHTML attribute? A. It must be in quotes and must be immediately after the equal sign. B. It must not be in quotes and must be immediately after the equal sign. C. It must be in quotes and must be immediately before the equal sign. D. It must not be in quotes and it must be immediately before the equal sign. E. All of the above are correct.
  7. Which of the following is not the name of an XHTML tag? A. p B. a C. head D. body E. tail
  8. What are the h1, h2, h3, etc. tags used for? A. To specify the heights of images. B. To indicates headings, sub-headings, sub-sub-headings, etc. C. To tell what hue (color) the text should be. D. To tell how big the text should be. E. To specify the URLs that links go to.
  9. What tag is required to be present in the head of an XHTML document? A. No tag: the head element is optional in XHTML documents. B. No tag: the head element may be empty in XHTML documents. C. The meta tag. D. The link tag. E. The title tag.

Exam ID: 9379 CS-081/Vickery Page 4 of 5

  1. What is the difference between the following two rules? p a { โ€ฆ } p, a { โ€ฆ } A. There is no difference: the comma is optional. B. The first one refers to anchors that are inside paragraphs, but the second one refers to all paragraphs and all anchors. C. The first one refers to anchors that follow paragraphs, but the second one refers to anchors that follow a comma in a paragraph. D. The pause between p and a is longer in the second one than in the first one. E. The first one is okay, but the second one is wrong because the comma-separated items are not listed alphabetically.
  2. What goes inside the curly braces of a CSS rule? A. Text to be capitalized. B. The title of the document. C. Information about what media the stylesheet applies to. D. A list of property names and their values. E. A list of property values and their real estate taxes.
  3. What goes immediately after each property name and value in a CSS rule? A. A period. B. A colon. C. A semicolon. D. A hyphen. E. A comma.
  4. What goes between each property name and its value in a CSS rule? A. A question mark. B. A period. C. A semicolon. D. A colon. E. A comma.
  5. Fill in the blanks. Yellow is a mixture of red and green lights. Use five different ways to represent pure yellow as a CSS property value: A. ____________________________________________________________ B. ____________________________________________________________ C. ____________________________________________________________ D. ____________________________________________________________ E. ____________________________________________________________
  6. Fill in the blank. Write any one way to specify a gray color as a CSS property value.
  7. Fill in the blank. Write any one way to specify the color black as a CSS property value.
  8. Which statement is correct? If you specify both a background color (other than transparent ) and a background image (that has no transparent parts) for an element โ€ฆ A. โ€ฆ the image will cover the color, and the content will cover parts of the image. B. โ€ฆ the color will cover the image, and the image will cover the content. C. โ€ฆ the image and the color will blend together, and the content will have a complementary color. D. โ€ฆ the color will cover the image, but the content will cover both. E. โ€ฆ the stylesheet will not validate because you cannot specify both a background color and a background image for an element.
  9. Short answer. Write your answer on the back of this sheet. Tell how to create and use a background image that provides a colored background that extends over the leftmost 20% of an element. Be specific about how to use CSS to accomplish this.

Exam ID: 9379 CS-081/Vickery Page 5 of 5

  1. Fill in the blanks. List four possible values for the background-repeat property, and tell what each does. A. ____________________________________________________________ B. ____________________________________________________________ C. ____________________________________________________________ D. ____________________________________________________________
  2. Which statement summarizes the CSS box model best? A. Each CSS rule specifies the dimensions of a box. B. Each box represents one CSS rule. C. There is a box for the content of each (X)HTML element displayed on the screen. D. CSS boxes are used to control the temperature of the web server. E. CSS boxes provide a security barrier around sensitive information.
  3. What are the components of a CSS box, from the outside going towards the inside? A. Content, text, border, padding. B. Text, margin, padding, image. C. Padding, margin, content, border. D. Margin, border, padding, content. E. Border, margin, padding, content.
  4. What is the difference between an inline box and a block box? A. Inline boxes have a line around them, but block boxes have a solid fill color. B. Block boxes hold blocks, but inline boxes hold lines. C. Block boxes are for text and inline boxes are for CSS. D. Block boxes are smaller than inline boxes. E. Each block box starts on a new line, but inline boxes flow across the page until there is no more room.
  5. Fill in the blank. What is whitespace , and what does the browser normally do with it?