Objects & Graphics

Your Assignment

Prerequisites

Before you begin this assignment, become a little more aquainted with Python, objected-oriented programming and graphics through the Graphics tutorial.

Then, read about and download the graphics.py Python module which is necessary for this graphical assignment in Installing graphics.py.

Five-click house

You are to write a program that allows the user to draw a simple house using five mouse clicks.

  1. Click 1 and 2 will mark the opposite corners of the rectangular frame of the house.
  2. Click 3 will indicate the center of the top edge of a rectangular door. The door should have a total width that is \(\frac{1}{5}\) of the width of the house frame. The sides of the door should extend from the corners of the top all the way down to the bottom of the frame.
  3. Click 4 will indicate the center of a square window. The window is \(\frac{3}{4}\) as wide as the door.
  4. Click 5, the last click, will indicate the peak of the roof. The edges of the roof will extend from the point at the peak to the corners of the top edge of the house frame.
../_images/house.svg

Submission Requirements

There are a few standards to adhere to when submitting your lab. Please read, and follow them carefully.

  1. Submission Filename: Submit a file named lab_objects_graphics.py.

  2. Documentation String (“docstring”): The following docstring (properly edited with your name) needs to be the very first thing in your Python program file.

    """CSC 161 Lab: Objects & Graphics
    
    This lab...
    
    Fox Mulder
    Lab Section TR 2:00-3:15pm
    Fall 2015
    """
    

    Read more about docstrings: Program Documentation String

  3. Comments (lines prefaced with #): Unclear parts of your code can receive point deductions, so be judicious about using comments. Do not overuse comments. Too much unnecessary commenting can complicate reading otherwise clear code!

    Read more about comments: Program Comments

  4. Python Code Style: You will need to run your Python program file through the online PEP 8 style checker found in CSC 161 Style.

The Blackboard post for this lab assignment will contain the details regarding the due date and other details regarding class administration for this assignment.

Grading

The following is the grading rubric for this lab to be used by the course graders. The lab is worth 100 points.

Here’s a brief grading rubric:
  • Syntax errors: -30 points
  • A bad/missing docstring (i.e. no name, lab section, etc): -10 points
  • Missing main() function: -10 points
  • Code doesn’t attempt to adhere to Python coding style: -10 points
  • The submitted filename is wrong: -5 points
  • No Python comments used when they are needed to clarify code: -5 points
Extra Credit:

There is no explicit extra credit for this assignment (if it changes, I will let you know).

I will allow you to add something creative and interesting to your program for extra credit. Your extra credit additions needs to be relevant to the techniques we are learning. You are not guaranteed to receive extra credit, it will be up to the lab TA to decide. If your extra credit code is not clearly documented using comments, you risk losing points instead of receiving bonuses.

Note: Extra credit is added your normal submission file, do not submit a second file. Extra credit supersedes any of the above grading rubric if it conflicts.

Note 2: There may be additional criteria for grading, this is just a summary of the major rubric items.