Comp 150 Final Exam study guide

The final exam is Thursday, June 25.
 
The exam will cover the following material:
 
 
1. HTML
    Basic HTML : D&L 16.2
    Book exercises: p 526, #40, 41
   
2. Material on computer networks. See the networks handout (on my main Comp 150 page)  and Chapter 15 of Dale & Lewis.
    Book exercises: p 502, #32, 36, 41, 43, 44, 56, 58, 59, 60

3. Operating-system basics
    D&L chapter 10, especially 10.2
    Virtual memory
    User versus supervisor mode
    Book exercises: pp 347-350: 33, 57, 58, 59, 60, 61, 62, 63, 66, 67
 
4. Artificial Intelligence:  D&L 13.1, 13.2, 13.5
    Turing Test
    Why natural-language processing is hard
    representations for sentences
    Scripts
    Book exercises: p 437, # 31, 43

5. Relational database model, D&L 12.3
    Book exercises: p 405, 48, 49, 50, 51, 52
   
6. Python, including writing simple loops. Also review the python problems on the midterm study guide.

I will provide you with the same "syntax cheat sheet" for python that you had on the midterm, with a dictionary example added. You should be able to understand how dictionaries are used.
    

Sample problems:

For the more obscure HTML,etc examples, if this question were to appear on the exam then you would also be provided with an appropriate summary of basic HTML/cgi/python/whatever. (Note that #10 sort of does this.)

1. Write a python function to check each word in a list "wlist" for membership in a dictionary "dict". If word w is found in dict (if w in dict), return dict[w]. If no word matches, return "notfound".
 
    def wcheck1 (wlist):
     
 
(b). Write a python function to check each word in a list "wlist" for membership in dictionary "dict1". Then, if none of the words are in "dict1", check each word for membership in dictionary "dict2". Again, return dict1[w] if word w is in dict1; dict2[w] if a word is found in dict2, and "notfound" otherwise.
 
Be sure you check all the words for being in dict1 before you check any for being in dict2. An application of this might be a chatterbot where we first tried to match a dict1 word, and only if all those failed did we go on to dict2.
 
 
2. Discuss the security risks involved in having your browser run programs downloaded remotely from a web page, and discuss how java applets and Microsoft activeX each deal with these risks. 


3.         
(a). Write HTML for a simple page with two headings or subheads, two paragraphs below each header, and at least one unnumbered list of topics. (b). Write the html necessary to produce two-column text using a TABLE; create the table and show where the text would go. The result should look like this problem.

 
4. (a). List some reasons why natural-language interpretation is  so difficult.
 
(b). Discuss one way of representing natural-language sentences within the computer.
 
(c). In the sentence
     Mary saw the mountains flying to Denver  
discuss at least one possible way of determining whether "flying to Denver" modifies "Mary", "saw", or "mountains".
 

5. Consider the following network, with six hosts A-F and three routers R1, R2, R3. Assume each host needs its own entry in each router. Give routing tables for the routers. Each table will have two columns, one for destination (A-F), and one for the next hop. Represent the next hop as either a letter A-F (corresponding to a destination reached directly), or else one of the routers R1-R3. For example, E is reached by R1 with next-hop of R2.
 
 
    A                  C                  E
    |                  |                  |
    |                  |                  |
    R1-----------------R2-----------------R3
    |                  |                  |
    |                  |                  |
    B                  D                  F
 

 
 
6. Suppose you are generating a dynamic web page (perhaps as a result of an html form). You have a python variable LIS representing a list of strings. Write a Python loop to generate a series of paragraphs, one per string, each followed by a <hr> (horizontal rule) tag. Thus, if LIS is ['foo', 'bar', 'how are you'], the html should be
 
    <p>
    foo
    <hr>
    <p>
    bar
    <hr>
    <p>
    how are you
    <hr>
 
 
7. Consider the following html form. Write a python cgi program (it doesn't have to work, it just has to be plausible) that accesses the two fields and prints their sum:
 
<html>
<body>
<h2>Calculator</h2>
<form action="calc.cgi">
  First number is:
  <input type = "text" name="num1" size=20>
  <p>
  Second number is:
  <input type="text" name="num2" size=20>
  <p>
  <input type="submit">
</form>
</body>
</html>
 
 
8. How would the html above appear on the user's screen?
 
 
9. Write a <FRAMESET> specification so the frames will be arranged as follows:
 
    +---+---------+
    |   |         |
    |   +---------+
    |   |         |
    |   |         |
    |   |         |
    |   |         |
    +---+---------+
 
10. Write html for a table for the following. Rows are delimited <tr>...</tr>, cells (columns) within a row are delimited with <td>...</td>
 
    col1    col2    col3
    Tues    Wed     Thurs
    3       15      now it's time for html
    one    last     row
     

11. What is the significance of how IP addresses are assigned?
 
12. How does TCP implement reliable transmission, given that the underlying networks are inherently unreliable?