CSSE 120 -- Intro. to Software Development

Homework 10

  1. Complete the assigned reading for the next session (Zelle sections 8.3-8.6).
  2. (26 Points) Complete the ANGEL quiz over this reading. You'll find this on the course Angel page,
    under Lessons → Homework → Homework 10 → Loop Patterns and Booleans
  3. (15 Points) Finish the exercise you started in class: countPassFail.py, and commit your work to your repository using Subclipse.

    A reminder on how to commit:

    1. Make sure you are using the PyDev perspective.
    2. Right click the project or module you would like to commit back to the repository.
    3. Click on TeamCommit
    4. Add an appropriate Commit message; then click on the OK button.
For #4 and #5, you need to use the Session10 project that you checked out in class today using Subclipse.
  1. (40 Points) Create a function called circleOfCircles that takes five parameters and attempts to draws N circles whose centers are equally spaced around a (usually) larger circle.  Do not actually draw the larger circle that they are spaced around.  Parameters:
    1. a GraphWin object where it will do its drawing.
    2. N, the number of circles to draw.
    3. A Point that is the center of the "big" circle that the other circles surround.
    4. The radius of the "big" circle.
    5. The radius of the "small" circles.

    In circleOfCircles, you must first add a Boolean test to see if the entire circleOfCircles will fit inside the window.  If not, print a message to the console instead of drawing the circleOfCircles.  You may consider using the getHeight and getWidth methods of the GraphWin class in solving this problem.

    You should also test that N is greater than 2.  If not, print an appropriate message to the console instead of drawing the circleOfCircles.

    If the circleOfCircles will fit inside the window, you should be able to create some interesting patterns by calling your function with various parameters (in a 1000 by 1000 window). You might try (one at a time) the examples below, along with output from the first one.

    Commit your Session10 project, with an appropriate comment, to your repository.

  2. (40 Points) Function versions of pizza, polygon, and star.  Place all of your function definitions in one Python source file, pizzaPolyStar.py, already in the Session10 project.

  3. More Python culture: What's up with the shrubbery examples? Check out this visit of King Arthur to the Knights Who Say “Ni!”.