One group is chosen as the winner for each lecture exercise. Since many
groups can have correct answers, other criteria are also used for picking
the winning group. These include use of meaningful variable names,
meaningful prompts and output, use of whitespace and adherance to 201
coding standards. Even handwriting can be used to break a tie.
Each member of a winning group will receive 1 point of extra credit on the
If there is a tie between a group that has won previously and one that has
not, the new group will be declared the winner.
Extra Credit Winners
|SQUARE = 2
CUBE_SIDES = 6
CUBE = 3
def __init__(self, length):
self.length = length
area = CUBE_SIDES * self.length ** SQUARE
vol = self.length ** CUBE
|# Exercise: Defining New Classes
# File: cube.py
# Names: David Ring & Kameron Pyron
# Date: 5/10/10
# Description: This class defines a cube object using
# the length of a side as its sole parameter.
# It has methods to access side and return
# volume and surface area.
def __init__(self, side):
self.side = side
return self.side ** 3
return 6 * self.side ** 2
Monday, 17-May-2010 09:13:27 EDT