CSSE 120 -- Intro. to Software Development

Homework 6

  1. Read Zelle 6.1-6.4.
  2. (28 points) Complete the Angel quiz over this reading. You'll find this on the course Angel page, under Lessons → Homework → Homework 6 → Defining Functions
  3. (50 points) File input: In the last homework, we wrote a program, funcDump, that generated pairs of coordinates from a function and stored them in a file. Here, we will read those coordinates from that file and graph them.
    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 funcDump (treat the first number as the x coordinate and the second number as the y).
      • Close the file
    2. Test your program using your cos.txt output from funcDump. (Note: you must place cos.txt in the same folder as funcPlot.py to read it.) You may also test using the sample outputs for different functions below. (You could fix this, based on GraphWin's setCoords() method, but you don't need to do so.)
    3. Submit your Python source file to the funcPlot Drop Box in the Homework 6 folder on ANGEL.
  4. Please finish and submit the ViaPoints Robot program from HW5.
  5. Web link --- ACM SIGGRAPH: SIGGRAPH has been serving over 8,000 ACM SIGGRAPH members and the entire computer graphics and interactive techniques community. This site is home of many interesting articles on the computer graphics field.
  6. (10 points) Challenge Problem: This problem is not required, but is an interesting extension that you might like to try.

    1. Create a version of funcPlot.py that rather than just plotting points, draws lines between consecutive points.