IBCS1 - 1112 - February

From WLCS
Revision as of 08:26, 16 April 2012 by Admin (talk | contribs) (Protected "IBCS1 - 1112 - February" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Monday - Wednesday (2/27/12 - 2/29/12)

Warmup:

  • What is Object-Oriented Programming? Describe in layman's terms.

Agenda:

  • Object-Oriented Programming Review
  • Parts of a class
    • Class declaration at the top: class CLASSNAME:
    • Initializer: def __init__(self, PARAMS):
      • Give default or initialize values of attributes
    • Methods: def METHODNAME(self, PARAMS):
      • A function inside a class
  • Python Class References
  • Class-wide construction of an object-oriented program
    • Point class example review
  • Circle class practice
    • Attribute(s): radius
    • Method(s):
      • __init__(self, radius=0)
      • __str__(self)
      • getRadius(self) - returns the radius of the circle
      • setRadius(self, newRadius) - changes the self.radius to newRadius
      • getDiameter(self) - returns the diameter of the circle
      • getArea(self) - returns the area of the circle
  • Rectangle class practice
    • Attribute(s): width, height
    • Method(s):
      • __init__(self, width=0, height=0)
      • __str__(self) - returns a string like "Rectangle WIDTH by HEIGHT"
      • getWidth(self) - returns the width
      • setWidth(self, newWidth) - saves newWidth into self.width
      • getHeight(self) - returns the height
      • setHeight(self, newHeight) - saves newHeight into self.height
      • getArea(self) - returns the area of the rectangle
      • isSquare(self) - returns True if the width is equal to the height, otherwise return False
  • Create a Student class with the attributes on the board

Thursday (2/23/12)

Agenda:

  • List, nested list, and for loop quiz
  • Demo missing assignments
  • Introduction to Object-Oriented Programming
  • Class-wide construction of an object-oriented program
    • Point class example
    • Circle class example
    • Rectangle class example
    • Create a Student class with the attributes on the board

Tuesday (2/21/12)

Warmup:

  • Assume you have a matrix = [ [2, 4, 6], [1, 3, 5], [0, 1, 2] ]
  • Write a nested loop that sums all the elements

Agenda:

  • Complete Nested List demos (multiplying matrices is optional)
  • Nested Loops review
  • Pig Latin Translator w/ Lists
  • List Surprise
  • Closed-book Quiz on Thursday (2/23/12)
    • Lists
    • Nested Lists
    • String Lists
    • for loops

Tuesday - Thursday (2/14/12 - 2/16/12)

Warmup:

  • Assume you are given the following code:
a = ???
b = ???

#Using an additional variable, swap the values in a and b (even though you don't know what they are)

Agenda:

  • Complete Advanced Python List Exercises
  • Introduction to Nested Lists
    • Nested List Practice
    • Application in matrices
    • Other applications
  • Nested List Practice
    1. Create a program that calculates the determinant of a 2x2 matrix. Be sure to test your program.
    2. Create a program that calculates the determinant of a 3x3 matrix. Be sure to test your program.
    3. Create a program that multiplies two matrices against each other

Wednesday - Friday (2/8/12 - 2/10/12)

Warmup:

Agenda:

Monday (2/6/12)

Warmup:

  • On a separate sheet of paper, write out the algorithm to find the minimum number in a list of numbers

Agenda:

Tuesday - Thursday (1/31/12 - 2/2/12)

Warmup:

  • Create a Python Turtle program that tells the turtle to move forward 100
  • Don't forget about exitonclick()

Agenda: