CS105 Mid-Term Exam (Spring 2008) 1. Explain in what sense the role of punch cards in the Jacquard loom (Joseph Jacquard’s fabrics weaving machine) is similar to the role of the software (computer programs) in the modern computers? (10points) 2. Explain each of the three major generations of computers in couple of sentences. (Hint: First generation computers used Vacuum tubes. Second generation was due to invention of transistors and third generation was after invention of Integrated Circuits, ICs.) (20 points) 3. Define an Algorithm and provide an example of an algorithm with at least four steps. (15 points) 4. Explain what is the difference between a WYSIWYG (What You See Is What You Get) word processer and a non-WYSIWYG word processor? Give an example of each of the two types. (15 points) 5. Give two reasons, why TCP (protocol) splits the data into packets (smaller chunks) before transmitting it along the network. (15 points) 6. Explain each of the following Computer Networking terms in one or two sentences. (25 points) - DNS (Domain Name Server) - Mail Server - TCP (Transmission Control Protocol) - IP Address - HTTP (Hypertext Transfer Protocol ) 7. What does Recovery mean in computer terminology? (10 points) 8. Write a simple HTML document with the following properties: a. It has a table which looks like this: (35 points) HEADER1 HEADER2 n11 Link to UMB n21 n22 Note o The first row is the header row. o n11 is bold o The cell under HEADER2 is a link to Umass/Bos homepage (http://www.umb.edu) o n21 is underlined. b. It has an unordered list of three items: item1, item2 and item3 with bullets of type “DISK”. c. The HTML document has a background image called flower.jpg. d. It has a horizontal line which takes about 50% of the screen an aligned from left. Some of the HTML tags that you need: <a href=“URL”>:creates a link to the specified URL. <table cellpadding=”n” border=”n”> : creates a table. <tr> : creates a table row. <td> : creates a data cell <th> : created a header cell <b> : bold text <u> : underlined text <hr width=”n%” align=”left”, “right” or “center”> : Draws a horizontal line. <ul type= “DISK”, “CIRCLE” or “SQUARE”> : Creates an unordered list. <li> : defines a list item. 9. Is the following XML well-formed? Why or why not? (8 points) <XML_Notes> <Note number=”1”> XML is a computer language</Note> <Note number=”2”>XML is a markup language </Note> </XML_Notes> 10. Which one of the following two XML’s is preferable to other the one (semantically) for representing a catalog of plants? Why? (20 points) A) <CATALOG> <PLANT> <COMMON>Bloodroot</COMMON> <BOTANICAL>Sanguinaria canadensis</BOTANICAL> <ZONE>4</ZONE> <LIGHT>Mostly Shady</LIGHT> <PRICE>$2.44</PRICE> <AVAILABILITY>031599</AVAILABILITY> </PLANT> <PLANT> <COMMON>Columbine</COMMON> <BOTANICAL>Aquilegia canadensis</BOTANICAL> <ZONE>3</ZONE> <LIGHT>Mostly Shady</LIGHT> <PRICE>$9.37</PRICE> <AVAILABILITY>030699</AVAILABILITY> </PLANT> </CATALOG> B) <CATALOG> <Bloodroot> <BOTANICAL>Sanguinaria canadensis</BOTANICAL> <ZONE>4</ZONE> <LIGHT>Mostly Shady</LIGHT> <PRICE>$2.44</PRICE> <AVAILABILITY>031599</AVAILABILITY> </Bloodroot> <Columbine> <BOTANICAL>Aquilegia canadensis</BOTANICAL> <ZONE>3</ZONE> <LIGHT>Mostly Shady</LIGHT> <PRICE>$9.37</PRICE> <AVAILABILITY>030699</AVAILABILITY> </Columbine> </CATALOG> 11- Consider the following XML: <Menu> <food price=”5.0”> <name>Hamburger</name> <calories>1100</calories> <served>Lunch, Dinner</served> <description> A very tasty …</description> </food> <food price=”3.0”> <name>Macaroni and Cheese</name> <calories>950</calories> <served>Lunch</served> <description> Home style …</description> </food> <food price=”5.0”> <name>Pizza</name> <calories>1220</calories> <served>Lunch, Dinner</served> <description> Oven …</description> </food> </Menu> We want to write an XSL style-sheet for the above piece of XML to have an unordered list of foods with price exactly equal to $5.0 in HTML. Here is the XSL to do this task: <?xml version="1.0" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <HTML> <HEAD> <TITLE> List of Foods </TITLE> </HEAD> <BODY> <UL TYPE="square"> <xsl:for-each select="……… 1 ……….."> <xsl:if match=".[……… 2 ……….. ]"> <LI> <xsl:value-of select="="……… 3 ……….."/> </LI> </xsl:if> </xsl:for-each> </UL> </BODY> </HTML> </xsl:template> </xsl:stylesheet> Write the XSL paths that should be placed in gaps 1, 2 and 3. (18 points) 12- We have an XML file and we want to style or filter it using XSL. When do we need to use the XSL tag : <xsl:for-each select = ”some path”> …. </xsl:for-each> in our XSL style-sheet? (9 points) Total: 200 points Good Luck!