Computer Technology and Society

Assignment 9

  1. Problem 1 at the end of Chapter 6 on page 320 in the textbook.

  2. Problem 7 at the end of Chapter 6 on page 320 in the textbook.

  3. Draw the parse tree for the expression x - y * z + y * x based on the syntax diagrams in Figure 6.16 on page 299.

  4. Download Python 2.5 and read the introduction to the IDLE programming environment that comes with Python 2.5.
    1. Enter the following Python program (note that spaces at the beginning of the line make a difference in Python):
         temp = input("What is the temperature?")
         if temp < 5:
             print "It is rather cold."
             print "This is fine."
    2. Change the program such the it checks if the temperature is higher than 30 and if so then prints out appropriate message.

  5. Consider question 4 in "Social Issues" at the end of Chapter 6 on page 325. Write down a few sentences on your views and be ready to discuss the issue in the section.

Hand these exercises in before noon on tuesday October 31st.

Extra exercise
Those who want to learn more about Python should do Exercise 1 in Instant Hacking, a web page that has an unorthodox introduction to Python.
hh (hja), October 24th, 2006.