CS 105 Midterm Examination Solutions -- Fall 1997
    1. <ul>
          <li>Call me whatever you want, but...</li>
          <li>Do not call between 9am and 3pm</li>   <<-- add ``/''
          <li>This is not a great picture</li>
      </ul>
      
    2. <UL>
      <LI> email basics
      <LI> regular table <br> layout
      </UL>
      
    3. <TABLE>
      <TR COLSPAN=2> <TD COLSPAN=2> Some Entry </TD> </TR>
      <TR>
      <TD> One item </TD>
      <TD> Another </TD>
      </TR>
      </TABLE>
      
    4. This one (which really did come from a student's web page) was so far off I admit it is hard to say what the correct answer was. In particular, the <LI> tag was completely out of place. The correct answer would be something like:
       
      <P><B><H2><CENTER><LI>R.C. Abalone's Picture page</CENTER></H2></B>
      
      <P> <H2 ALIGN=CENTER><B>R.C. Abalone's Picture page </B> </H2>
      
  1. Look familiar?
    1. 1001101001101001
    2. 11000011110011000011110011000011
    3. eight bits
  2. 
    <table width=200 border=1>
       <tr>
          <td colspan=2 align=center> A </td>
       </tr>
       <tr>
          <td align=right width="50%"> B </td>
          <td rowspan=2 valign=bottom > D </td>
       </tr>
       <tr>
          <td> C </td>
       </tr>
    </table>
    
    1. The version of Java I used last year did not require the use of the works "public" or "private" in method definitions. To keep things clear for you, however, I have include them as corrections in the answers shown.
      public void mouseUp( int x, int y) {
      
           pen.fillRect("Yellow");
           pen.fillRect(int x, int y, 10, 10);
      }
      
    2. public void begin( ) {
      
           void drawSmileyFace( 30, 30);
      
      }
      
  3. This was not a very good question (isn't hindsight wonderful).

    What I was looking for was a recognition of the fact that network B had more redundant pathways than network A. In network A if the line between 3 and 6 gets too busy (or worse yet is cut), there is not alternate route between the machines to the left of 3 and those to the right. In network B there is no single line that is absolutely required to support communication between two such subsets.

  4. The two issues that lead to approximation in digital images and digital sound recording are the sampling rate and the sample accuracy. In the case of images, the sampling rate is just the number of pixels per inch. The more pixels per inch, the more accurate the representation can be. In each pixel, however, there is also another form of approximation related to how many digits (bits) of accuracy are used to represent the color of the pixel. The fewer digits used to represent colors, the more approximate each pixels color will be. Thus, 24-bit color is more accurate than 8 bit color.

    In the world of digital sound, the sampling rate is simply how many times per second the amplitude of the sound wave is measured. The sample accuracy is determined by the number of digits used to represent the amplitude at a given time. When discussing the phone system, I mentioned that 8 binary digits are used to represent the amplitude of each sample of the sounds sent through a phone call. Thus, only 256 different sound amplitudes can be represented exactly. Amplitudes that fall between these 256 values must be rounded (approximated) up or down.