CS 105 Midterm Examination
Wednesday, Oct. 29, 1997

NAME:

Question Points Score
1 24  
2 15  
3 16  
4 10  
5 15  
6 10  
TOTAL 100  

There are 6 questions on this examination. The point values associated with the questions are shown in the table above. You have 50 minutes to complete the examination. You should not consult any references while completing this examination. Show all answers in the spaces provided in the examination booklet. Paper for scrap work will be made available.

  1. Below, I've included several fragments of HTML text. Many of the fragments shown were actually taken from pages produced in 105 labs (with minor modifications intended to eliminate items that identified the author).

    Each item contains one or more mistakes. For each item, please briefly explain each of the mistakes you notice and indicate how to modify the HTML to make it correct while producing what the author appeared to have in mind. You can either clearly mark up the code shown or write a complete revision in the space provided.

    1. The following tags for a three item list appeared in one of your tables lab. Unfortunately, it produced a four item list.
      <ul>
          <li>Call me whatever you want, but...</li>
          <li>Do not call between 9am and 3pm<li>
          <li>This is not a great picture</li>
      </ul>
      
    2. <UL>
      email basics <br>
      regular table <br> layout</UL>
      
    3. <TABLE>
      <TR COLSPAN=2> Some Entry </TR>
      <TR>
      <TD> One item </TD>
      <TD> Another </TD>
      </TR>
      </TABLE>
      
    4. <P><B><H2><CENTER><LI>R.C. Abalone's Picture page</CENTER></H2></B>
      
  2. The drawing below is intended to represent a digital signal as it might be sent across a wire between two computers.
    1. Assuming that the signal sent is encoded using "on-off keying" and that the width of each grid box shown in the drawing corresponds to the time required to send one bit, show the sequence of 0's and 1's this message would represent.
    2. In the preceding question, you were told to assume that the width of each grid box corresponded to the time used to send a single bit. Suppose instead that the width of each grid box represented the time required to send two bits. What sequence of 0's and 1's would this message now represent?
    3. Suppose that instead of using on-off keying, the computer sending the signal shown was using manchester encoding to send this signal. In this case, how many 0's and 1's would the signal encode? (You don't need to tell me what the signal is, just how long it is.)
  3. Write the HTML tags required to produce the table shown below. Pay careful attention to the alignment of text within table cells. You may assume the total width of the table is 200 pixels.
  4. The following Java method definitions are invalid. Show how to correct the errors to produce valid methods. As in the HTML questions above, you may either clearly indicate the changes required to the text shown or rewrite the definitions completely in the space provided.
    1. void mouseUp( x, y) {
      
           pen.fillRect("Yellow");
           pen.fillRect(int x, int y, 10, 10);
      }
      
    2. void begin( ) {
      
           void drawSmileyFace( 30, 30);
      
      }
      
  5. Two possible sets of interconnections that might be used to build a switched network including a given set of computers is shown below. Describe any advantages either of these sets of interconnections would have over the other.
  6. In discussing the importance of "being digital", I explained that certain non-digital forms of information, like sound and images, could not be represented perfectly in digital form but could be approximated very accurately by digital representations. For either sound or images, explain two forms of approximation present in the approaches to the digital representation of such information we discussed. For each approximation, explain how one can reduce or increase the accuracy with which the original information is preserved.