CSSE 120 -- Intro. to Software Development

Homework 5

  1. Complete the assigned reading for the next session, Zelle sections 5.1- 5.7, 5.9 (skim 5.8 as reference).
  2. (26 pts) Complete the Angel quiz over this reading. You'll find this on the course Angel page, under Lessons → Homework → Homework 5 → Graphics and Objects
  3. (30 pts) Decoding messages: Suppose you are a security agent who encrypts messages that you send to other agents.  Of course, the receiving agents need to be able to decode the encoded messages they receive from you.  Assuming that both you and the agents receiving your messages share a common key that you use to encode and decode messages, write a decode module in a file named decode.py that uses a common key to encode and decode messages.  Your decode module should be able to:
    1. Prompt the user for a list of numbers
    2. Prompt the user for a key
    3. Reverse the calculation of the encode module used in the encoding example done in class to return the original string.  Note:  You may wish to consider using string's join method.  In IDLE type help(string.join) at the prompt after importing the string module.

    Submit your Python source file and the generated output to the decode Drop Box in the Homework 5 folder on ANGEL.

  4. (30 pts) File output and string formatting: Storing information in files is a very important exercise for engineers running experiments that generate a large quantity of useful data.  The stored data can later be analyzed, categorized, and manipulated to allow engineers to draw useful conclusions. 

    Often, the generated data is formatted so that another program can automate the process of analyzing, categorizing, and manipulating the data. In this problem you are to write a program, funcDump.py, that implements the following design:

    Submit your Python source file and the generated output to the funcDump Drop Box in the Homework 5 folder on ANGEL.

  5. If you didn't do this for bonus points last session, you need to do it now (for no bonus)... In the next session, we will begin using a new development environment called PyDev that runs inside Eclipse. Freshman laptops have some of these steps done, as noted below:
    1. Install Eclipse by following these instructions. (Upperclassmen need to update to Eclipse 3.4; freshmen can skip this.)
    2. Install and configure PyDev for Eclipse by following these instructions. (Upperclassmen need to do all of this; freshmen can skip the beginning and start at step 3 of Install the PyDev plug-in for Eclipse.)
    3.  Install and configure Subclipse for Eclipse by following these instructions. (Everyone needs to do this.)
    4. You must show us in class next session (if you haven't already):
      1. Launch Eclipse and show us your Hello World Python program running.
      2. In Eclipse, show us your modified "spam.py" file that you checked out using Subclipse. If you didn't get this working, instead choose Window > Open Perspective > Other..., and show us that "SVN Repository Exploring" appears in the list.
  6. Challenge Problem: This problem is not required, but is an interesting extension that you might like to try.
    1. Create a version of funcDump.py that prompts the user to enter the function for column 2 instead of hard-coding the function.
  7. Web links, bacon, eggs, and spam: One of today's in-class examples was a reference to the Penguin sketch. We hope you enjoy this four minute cultural experience!