Course Home | Assignments | Computing Resources | Lab Hours/Tutoring | Python | Schedule | Submit

Saint Louis University

Computer Science 150
Introduction to Object-Oriented Programming

Michael Goldwasser

Spring 2013

Dept. of Math & Computer Science

Homework Assignment 07

Good Software Practices

Contents:


Overview

Topic: Good Software Practices
Related Reading: Chapter 7
Due: 1:10pm, Friday, 5 April 2013 ELECTRONICALLY

Please make sure you adhere to the policies on academic integrity.


Problems to be Submitted (20 points)

Note: Although the "homework" sets are typically submitted on paper in class, we have chosen to have this assignment submitted electronically (for reasons that will soon be obvious). We have created a folder hw07 on the online submit system for this purpose (not to be confused with unrelated prog07).
  1. (10 points)

    Exercise 7.5 of the text

    Please do this problem electronically. You should be able to see the effect of your documentation by doing help(Point) in the interpreter after loading the definitions.

    The original undocumented code can be found here (or as turing:/Public/goldwasser/150/book/ch06/RobustPoint.py)

  2. (10 points)

    Exercise 7.8 of the text

    Please see Practice 7.6 and its solution for a start (albeit brief).

    Although unintentional, this is a particularly relevant exercise given that the version of Fraction published in the book is flawed! The provision of __eq__ and __lt__ does not suffice for supporting all of the expected comparison operators: <, <=, > >=, ==, !=. Make sure that your unit tests examine each of those operations, and that they tangibly demonstrate the flaws that exist with the published code. My recommend style for this is to have tests that produce no output when the code is successful, but error messages when a flaw is discovered.

    The original untested code, together with embedded gcd function, can be found here (or piecewise within turing:/Public/goldwasser/150/book/ch06/).


Extra Credit

  1. (2 points)

    Exercise 7.9 of the text


Michael Goldwasser
CSCI 150, Spring 2013
Last modified: Monday, 25 March 2013
Course Home | Assignments | Computing Resources | Lab Hours/Tutoring | Python | Schedule | Submit