Difference between revisions of "IB Computer Science 1"

From WLCS
(Wednesday (2/3/11))
Line 1: Line 1:
 +
== Monday (2/7/10) ==
 +
'''Warmup:'''
 +
Let's practice writing GASP code from scratch (15 minutes)
 +
 +
# Create a new program named gaspReview.py
 +
# Open a graphics window
 +
# 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
 +
# 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
 +
# Test out the program
 +
# Optional: if it runs, then try adding 2 more circles that have different speeds
 +
 +
'''Agenda'''
 +
* Demo Email Harvester, if you haven't already
 +
** Submit your code to school web lockers, so I can get you feedback
 +
* Demo Dodge (submit that too)
 +
* Study lists [http://openbookproject.net/thinkcs/python/english2e/ch09.html HTTLACS Ch 9]
 +
** Complete exercises #1-5
 +
 
== Wednesday (2/3/11) ==
 
== Wednesday (2/3/11) ==
 
'''Warmup:'''
 
'''Warmup:'''

Revision as of 11:39, 7 February 2011

Monday (2/7/10)

Warmup: Let's practice writing GASP code from scratch (15 minutes)

  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
  6. Optional: if it runs, then try adding 2 more circles that have different speeds

Agenda

  • Demo Email Harvester, if you haven't already
    • Submit your code to school web lockers, so I can get you feedback
  • Demo Dodge (submit that too)
  • Study lists HTTLACS Ch 9
    • Complete exercises #1-5

Wednesday (2/3/11)

Warmup:

  • Build up a string
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:

Tuesday (2/1/11)

Warmup:

  • Create a small program that counts the number of vowels in a string.
    • Example: "IceBerg" returns 3, and "IBM invented the mainframe!" returns 8.
  • If you're done, extend the program to count consonants too.
    • "IceBerg" has 4 and "IBM invented the mainframe!" has 14.

Agenda:

Friday (1/28/11)

Snow day

Wednesday (1/26/11)

Warmup:

  • Put the following sentence in a string:
Maybe there are greater aggravations in your life, but the symmetrical-on-the-outside, asymmetrical-on-the-inside USB connector has been a source of frustration since its introduction.
  • Write a small program that iterates through the string from the end and prints out every word in reverse order.
    • Hint: keep track of the index of the current word's last letter.
  • For bonus points, detect when words are separated by any punctuation mark, not just a space. Don't print the punctuation itself.

Agenda:

Monday (1/24/11)

Warmup:

  • Using python, create a string "Weʼre Building a Better Internet", and save it in variable sample.
  • Write expressions that:
    • Print the first character
    • Print the third character (the apostrophe)
    • Print the second from last character
    • Print the word 'Building'

Agenda:

Monday (1/24/11)

Warmup:

  • Using python, create a string "Weʼre Building a Better Internet", and save it in variable sample.
  • Write expressions that:
    • Print the first character
    • Print the third character (the apostrophe)
    • Print the second from last character
    • Print the word 'Building'

Agenda:

Thursday (1/20/11)

Agenda:

Friday (1/14/11)

Agenda:

Wednesday (1/12/11)

Warmup:

  • Without using the computer, what does the following code display?
from gasp import *
begin_graphics(width=800, height=600, title="Question 23")

x = 0
while x < 100:
  Circle( (400 + x, 300), x )
  x = x + 10

update_when('key_pressed')
end_graphics()

Agenda:

Monday (1/10/11)

Agenda:

Thursday (1/6/11)

Agenda:

  • 2nd Quarter Exam will be on Monday (1/10/11)
  • 2nd Quarter Exam Review
  • input, output, variables, and math expressions
  • functions
    • function definitions
    • function header
    • function body
    • return keyword
  • if statements
    • comparison operators
      • ==
      •  !=
      • <
      • >
      • <=
      • >=
    • Boolean operators
      • and
      • or
      • combining Boolean operators
  • while loops
    • sequences
    • break keyword
  • GASP
  • Catch/Follow game
  • Exam Format:
    • Open and closed-book sections
    • Multiple-choice
    • Short-answer code
    • Identify syntax errors
    • Identify the purpose of code sections

Tuesday (1/4/11)

Warmup:

  • Write the while loop that generates the first N terms of the following sequence (prompt for N):
    • 1, 2, 4, 7, 11, 16, 22, ...

Agenda:

Thursday - Friday (12/23/10 - 12/31/10)

  • Non-denominational winter break

Wednesday (12/22/10)

Tuesday - Monday (12/14/10 - 12/20/10)

Agenda:

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

Warmup:

  • Listed below are the major components of pretty much every type of game
    1. game loop
    2. game information and objects
    3. game rules/behavior
    4. refresh screen
  • What is the programming construct/concept that we use for each of the above?

Agenda:

Monday (12/6/10)

Warmup:

  1. Copy, paste, and execute the code from Section 8.8 in Case Study: Catch
  2. Make sure you understand how the code works
  3. Comment sections of the code to explain what those lines do

Agenda:

Thursday (12/2/10)

Agenda:

Archives