Difference between revisions of "IB Computer Science I"

From WLCS
Line 1: Line 1:
== Monday - Tuesday (3/15/10 - 3/16/10) ==
+
== Monday - Wednesday (3/15/10 - 3/17/10) ==
 
* Contact class
 
* Contact class
 
* AddressBook program
 
* AddressBook program
Line 9: Line 9:
 
*#* You can grab the current element's attribute like this: book[x].firstName
 
*#* You can grab the current element's attribute like this: book[x].firstName
 
*# If there is a match, then print out the Contact's info (book[x].info)
 
*# If there is a match, then print out the Contact's info (book[x].info)
 +
* Implement the (r)emove option
 +
*# Prompt the user for a first name
 +
*# Prompt the user for a last name
 +
*# Using a loop, traverse the book list and check if the first name matches and if the last name matches
 +
*#* You can grab the current element's attribute like this: book[x].firstName
 +
*# If there is a match, then delete the element from the book list (HINT: del book[x])
  
 
== Friday (3/12/10) ==
 
== Friday (3/12/10) ==

Revision as of 09:21, 17 March 2010

Monday - Wednesday (3/15/10 - 3/17/10)

  • Contact class
  • AddressBook program
  • As a class, you should have (a)dd and (p)rint
  • Implement the (s)earch option
    1. Prompt the user for a first name
    2. Prompt the user for a last name
    3. Using a loop, traverse the book list and check if the first name matches and if the last name matches
      • You can grab the current element's attribute like this: book[x].firstName
    4. If there is a match, then print out the Contact's info (book[x].info)
  • Implement the (r)emove option
    1. Prompt the user for a first name
    2. Prompt the user for a last name
    3. Using a loop, traverse the book list and check if the first name matches and if the last name matches
      • You can grab the current element's attribute like this: book[x].firstName
    4. If there is a match, then delete the element from the book list (HINT: del book[x])

Friday (3/12/10)

  • Heritage / Black History Assembly

Wednesday - Thursday (3/10/10 - 3/11/10)

Warmup:

  • Let's try to create a Rectangle class
    • Write down the attributes/properties of Rectangle
    • Write down some methods/behaviors of Rectangle

Agenda:

  • Introduction to Python classes (objects)
  • Point class example
  • Circle class example
  • Rectangle class example
  • Create a Contact class on your own
  • We'll create an sample AddressBook program as a class

Monday (3/1/10)

Warmup:

  • Write a while loop that traverses and adds 5 to each element in the following list:
    • myList = [1, 5, 2, 7, 98, 4, 43, 2, 6, 4, 2]

Agenda:

Tuesday - Friday (2/23/10 - 2/26/10)

Warmup:

  1. Create an empty list named randList
  2. Using a loop that runs 100 times, append 100 random numbers (0-100) to randList
  3. Using another loop and an additional variable, traverse the list and sum up all the numbers
  4. Print out the sum

Agenda:

  • List Review
  • HTTLACS: Ch9 #1-5
  • List Exercises
  • Extra Credit: Sign up and help out with Gotta Gadget
    • March 9 from 4:30-6:30 at Central Library

Monday (2/22/10)

Warmup:

  1. Create an empty list named randList
  2. Using a loop that runs 100 times, append 100 random numbers (0-100) to randList
  3. Using another loop, print out only the odd numbers

Agenda:

Friday (2/19/10)

Warmup:

  1. Create an empty list named randList
  2. Using a loop that runs 100 times, append 100 random numbers (0-100) to randList
  3. Using another loop, count the number of random numbers in the list that are over 50
  4. Print the count

Agenda:

Tuesday - Thursday (2/16/10 - 2/18/10)

Warmup:

  1. Create a new program named gaspReview.py
  2. Open a graphics window
  3. Display a circle on the screen and save it as a variable named c
    • Be sure to create x and y variable coordinates for it
  4. Create a while loop that moves the circle across the screen to the right
    • If the circle's x-coordinate moves beyond the right side, change it's x-coordinate to 0
    • Randomize the y-coordinate between 0 and 600
  5. Test out the program, if it runs, then try adding 2 more circles that have different speeds

Agenda:

  • You will demo the above warmup at beginning of next class
  • Demo Robot game
  • Introduction to Lists
    • HTTLACS: Ch9 #1-5

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

  • Snowpacolypsegeddon!

Thursday - Monday (1/21/10 - 1/25/10)

  • My first custom game
    1. Use the template for a basic game (begin_graphics(), while loop, etc)
    2. Add a school-appropriate image of your choice and make it move around the screen using the keyboard
    3. Add 3 items on the screen that can be collected
    4. There should be a label at the top of the screen that displays the number of items collected
    5. Add 3 mines on the screen that end the game if the player hits them

Wednesday (1/20/10)

  • Go over 2nd quarter exam

Thursday - Friday (1/14/10 - 1/15/10)

Warmup:

Agenda:

  • Complete Pong

Tuesday - Wednesday (1/12/10 - 1/13/10)

  • 2nd Quarter Exam

Thursday - Monday (1/7/10 - 1/11/10)

Monday - Wednesday (1/4/10 - 1/6/10)

Warmup:

  • In three words, summarize your winter break

Agenda:

  • 2nd Quarter Exam will be next Tuesday (1/12/10)
  • If-statement review
    1. Prompt the user to enter a username and store it in a variable named username
    2. Prompt the user to enter a password and store it in a variable named password
    3. Using an if-statement, check if the username equals "admin" and the password equals a password of your choosing
    4. If the login is successful, then print that the "You have successfully logged in"
    5. If the login fails, then print "Authentication failure!"
  • While statement
    1. Practice: Write a loop that prints out 1 through 5
    2. Write a while loop that runs exactly 5 times, each time the loop runs, print out "Login Trial #N" where N is the loop counter
    3. Take the if-statement code and put it inside the loop
    4. If the user successfully logs in, then also break out of the loop using the break keyword
  • strings
  • Case Study: Catch review
  • Using your own images
  • Using your own sounds
  • Complete your Pong program

Friday - Monday (12/11/09 - 12/14/09)

  • Case Study: Catch

Tuesday - Thursday (12/8/09 - 12/10/09)

Warmup:

Agenda:

Monday - Friday (11/30/09 - 12/4/09)

Warmup:

  • Assume you have the following code:
s = ""
x = 0
while x < 5:
  s = s + "a"
  x = x + 1
print s
  • What is printed out after the code executes? (DO NOT USE A COMPUTER)

Agenda:

Monday (11/23/09)

Warmup:

  • Breakfast
  • Take out a sheet of paper and draw a coordinate plane with x and y axes.
  • The x-axis should go from 0 to 640
  • The y-axis should go from 0 to 480
  • Draw the turkey on the board or something like it
  • Estimate the major points (x,y) for the turkey

Agenda:

Monday - Friday (11/16/09 - 11/20/09)

Monday - Friday (11/9/09 - 11/13/09)

Monday - Friday (11/2/09 - 11/6/09)

Warmup:

  • Write a loop that prints out the first 100 even numbers

Agenda:

  • Demo HTTLACS: Ch 5 exercises
  • Introduction to Iteration
    • Complete HTTLACS: Ch 6 exercises #1-6 - DO NOT submit to SchoolWebLockers
  • Practice Exercise #1
    • Prompt the user two choices: odd or even
      • Example: Would you like odd/even?
    • Prompt the user for a number and store it in a variable n
    • If the user chooses odd, then print out the first n odd numbers (starting at 1) using a loop
    • If the user chooses even, then print out the first n even numbers (starting at 0) using a loop
  • Practice Exercise #2
    • Print out all the numbers that are divisible by 6 from 0 through 100
  • Guessing Game Assignment

Tuesday - Friday (10/27/09 - 10/30/09)

  • Complete the HTTLACS: Ch 4 GASP exercise and demo to Mr. Bui
  • Work through HTTLACS: Ch 5 and by work through, Mr. Bui means that you should try out all the code.
  • Complete the HTTLACS: Ch 5 exercises

Monday (10/26/09)

  • 1st Quarter Exam

Friday (10/23/09)

Monday - Thursday (10/19/09 - 10/22/09)

Warmup:

  • What does the following code print?
x = 9
y = 10
z = 4

if x < y:
  if z < 0:
    print "Washington"
  else:
    print "Lee"
else:
  print "Generals"

Agenda:

Thursday (10/15/09)

Warmup:

  • What do the following conditions evaluate to?
not(False)
True or False
False and False
True and False
not(True or False)
True or True
False and True
False or True
not(False) and True
not(True) or False
not(True) or True

Agenda:

Tuesday - Wednesday (10/13/09 - 10/14/09)

Thursday - Friday (10/7/09 - 10/8/09)

Warmup:

  • Create a python script that prompts the user for three integer variables: month, day, and year
  • Print your birthday using the variables
  • Your birthday should use the following format: M/D/Y

Agenda:

Monday - Tuesday (10/5/09 - 10/6/09)

Thursday (10/1/09)

Archives