Post date: Nov 03, 2011 9:59:3 PM
Announcements
None
Homework
If necessary, work on Project 8: Graphics Objects
If necessary, In Chapter 10: Defining Classes, read
section 10.3.1, pages 305..309
section 10.4, pages 311..315
Take D2L quiz for Chapter 10: Defining Classes before your next lab
Lecture Outline
Using an existing class and developing another there is a handout today for everyone
Use class Projectile, an existing class (not part of Python) form Zelle to build a game of Tanks.
class Projectile:
# Create a projectile with given launch angle, initial velocity and height
__init__(self, angle, velocity, height):
# Update the state of this projectile to move it time seconds farther into its flight.
def update(self, time):
# Returns the y position (height) of this projectile.
def getY(self):
# Returns the x position (distance) of this projectile.
def getX(self):
Develop class BankAccount from scratch
In-class: complete withdraw method to allow borrowing in increments of 10.00, maintaining that loan amount and adding a method named getLoanAmount