CSSE 120 -- Intro. to Software Development

Homework 5

  1. Complete the assigned reading for the next session (see the course schedule).
  2. 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. File output and string formatting: 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.

  4. In the next session, we will begin using a new development environment called "PyDev" that runs inside "Eclipse". Freshman laptops should already have PyDev and Eclipse installed, so freshman don't have to do this part. Upperclassmen need to install PyDev and Eclipse. Upperclassmen should follow these instructions:
    1. Install Eclipse by following these instructions.
    2. Install and configure PyDev for Eclipse by following these instructions.
  5. 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 three minute cultural experience!
  6. File input: This problem is due with Homework 6 rather than the current homework. Some people may find it a bit more challenging than previous problems, so we wanted to give you more time to work on it.
    1. Write a program, funcPlot.py, that implements the following design:
      • Prompt the user for a file name
      • Open a file with the given name
      • Display a graphics window with width 720 and height 400.
      • Read each line from the file. For each line, plot a point on the graphics window. You should assume the lines have the format specified in problem 3. Treat the first number as the x coordinate and the second number as the y.
      • Close the file
    2. Test your program using your output from problem 3. You may also test using the sample outputs for different functions below. (The functions are "upside down" because of the graphics coordinate system. Do you see how we could fix that?)
    3. Submit your Python source file to the funcPlot Drop Box in the Homework 6 folder on ANGEL. (This folder will be available by the middle of the week. We'll remind you to submit your funcPlot module on Homework 6.)
  7. Challenge Problems: These problems are not required, but are interesting extensions 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 hardcoding the function.
    2. Create a version of funcPlot.py that rather than just plotting points, draws lines between consecutive points.