CSSE 120 — Introduction to Software Development

Homework 4

Reminder: for each class session and associated homework:

  1. Complete the assigned reading for the next session: Zelle, §4.1–4.4.
  2. (20 points) In Angel, complete the Reading Quiz over the above reading.
  3. (20 points) With your pair-programming partner, complete the following two modules that you began in class:

    These are both in today's Eclipse project 04-ReviewAndPractice.

  4. (0 points, but required) There's a bug in the combination of Eclipse 3.5, PyDev, Python 3, and Windows. The bug affects the input function, causing the compound expression eval(input("prompt")) to fail. The fix is simple, but you must do it or you'll have trouble on future homework and projects.

    1. Download this sitecustomize.py file to your computer. Right-click that link and choose Save Target As, or the equivalent for your browser to save the file. IMPORTANT: Save the file to Downloads or Desktop, not site-packages.
    2. Drag the file to C:\Program Files\Python31\Lib\site-packages, as shown in the screenshot below. You need to download to Downloads or Desktop, then drag the file into the folder, otherwise the Windows permissions get messed up. When you drag the file in, Windows 7 will tell you that you need Administrator privileges to do that. Just Accept that dialog.

    3. Test that this works by creating a new Python module in Eclipse named check_input.py. Put the following code in that module:

      x = eval(input("Enter a number: "))
      print(x)
      

      Run the module and enter any number at the prompt. If the fix worked, the program should just print the number. If the fix did not work, the program will crash with the unhelpful message SyntaxError: unexpected EOF while parsing. If your program crashed, get help from me or one of the TAs.

  5. (20 points — 10 for each module) Working individually (but getting help if you’re stuck), complete the following two modules that you may have began in class:

    These are both in today's Eclipse project 04-ReviewAndPractice.

    Turn in your work by committing it to SVN.