






AP CS Materials 2009
I am helping teach an AP CS class at Lakeside High School. I am putting material here as I develop it. The class meets Monday - Friday for 50 minutes each day (but with roll and announcements at the end it is only 40 min). I plan to teach Alice and Media Computation during the first semester and then move on to GridWorld and Greenfoot for the second semester. See http://books.google.com/books?id=NwIbWrnyHeYC&pg=PA4&dq=Alice+programming&ei=u5-JSqisJpmwNLWZucYM#v=onepage&q=Alice%20programming&f=false for the 2nd edition of the Learning to Program with Alice book. We will be getting the just printed book Exploring Wonderland: Java Programming Using Alice and Media Computation by Wanda P. Dann, Stephen P. Cooper, and Barbara Ericson (me). My publisher is donating the books to the class and we should be getting them by week 3 (got them in week 3). I am putting some Alice tips and techniques videos at http://home.cc.gatech.edu/TeaParty/57. I am also putting Media Computation tips and techniques videos at http://home.cc.gatech.edu/TeaParty/61. The Java API is available at http://java.sun.com/javase/6/docs/api/.
Student Pages Cox AP CS A 2009-2010
Syllabus Cox AP CS A 2009-2010
Lakeside-APCSA-Syllabus.doc
15th week(Nov 16-20th)
What is a two-dimensional array (a matrix)? How do you use a nested loop to traverse a two-dimensional array?
Reading: Chapter 11
Monday and Tues - 11-NestedLoops-part1.ppt TwoDimensionalArraysAndNestedLoopsLab.doc Write a method to do a vertical mirror from right to left. Write a method to do a horizontal mirror from top to bottom. Write a method to do a horizontal mirror from bottom to top. If you have time write the method to do a diagonal mirror from lower left to upper right. If you have time also write a method to do a diagonal mirror (only in a square region of the picture) from top right to lower left. Turn in Picture.java.
Wed - Friday 11-NestedLoops-part2.ppt Write a method to copy a small picture (like flower1.jpg) to one of the blank pictures (like 640x480.jpg or 7inX95in.jpg). Write a method to create an image collage using at least 2 different pictures, use at least 3 different image manipulations like reduce red, negate, clear blue, etc, and mirror the results. Turn in Picture.java. See SIGCSE Birds of a Feather 2008 for example collages.
14th week (Nov 9-13th)
How is color represented on computers? How do you loop through all the pixels in a picture using a for-each loop, while loop, and for loop?
Reading: Chapter 10
Monday and Tues - present what you did with Sound for an Alice movie.
Wed - Read 10-ManipulatingPictures-part1.ppt and do IntroManipPictures.docx. Turn in Picture.java.
Thurs - Read 10-ManipulatingPictures-part2.ppt and create a copy of the increaseRed method and name it increaseRedWhile and change it to using a while loop. Write a method increaseDecreaseRed and in the first half of the array of pixels increase the red and then in the second half decrease the red (use 2 while loops). Turn in Picture.java.
Friday - Read 10-ManipulatingPictures-part3.ppt and make a copy of makeSunset() called makeSunsetWhile() and change it from using a while loop to using a for loop, also create the method grayscaleWithLuminance and turn in Picture.java.
13th week (Nov 2-6th)
Monday and Tues - 09-UsingSoundRanges-part3.ppt Do the challenges in the slides and turn in the modified Sound.java file
Wed and Thurs - Use what you have learned about manipulating sounds to create something for an Alice movie. Maybe create several sound clips from some music and splice it together to make a sound track for your Alice movie (a sound track that doesn't violate copyright since you are using short segments (under 10% of the music).
Friday - Present your Alice movie and explain what you did with the sound for it.
12th week (Oct 26-30th)
Monday - finish up labs from last week and review loops and conditionals. For those who finished the labs last week create a login at http://www.javabat.com. You can login and then give Mr. Cox access to your results on the prefs page at the bottom under Teacher-Share. Do Warmup-1 and Logic-1 problems.
Tues and Wed: 09-UsingSoundRanges-part1.ppt Do the challenges in the slides and turn in the modified Sound.java file.
Thurs and Friday: 09-UsingSoundRanges-part2.ppt Do the challenges in the slides and turn in the modified Sound.java file.
11th week (Oct 19-23rd)
How do we digitize sound? What affects the sound frequency and volume? How can we manipulate a sound by looping through all values in the sound? What is a for-each loop in Java? How can we loop while some condition is true in Java? How can we use a general for loop in Java? How do we handle conditionals in Java? What is an array and how can you loop through all the elements of an array?
Reading: Chapter 8
Additional Resources:
You can download the Media Tools from the book at http://home.cc.gatech.edu/TeaParty/51
http://phet.colorado.edu/simulations/sims.php?sim=Wave_Interference is a simulation of sound and water waves.
Monday - Test
Tues - 08-Intro-Sound-part1.ppt Do this worksheet: IntroSound.doc
Wed - 08-Intro-Sound-part2.ppt Add increaseVolume to Sound.java and test it. Create the method decreaseVolume that will change each value to half the original value in the sound. Add increaseVolumeWhile to Sound.java and test it. Create a decreaseVolumeWhile method that uses a while loop to decrease the volume of the sound. Add increaseVolumeFor to Sound.java and test it. Create a decreaseVolumeFor to Sound.java and test it. Add changeVolume to Sound.java and test it. Turn in the modified Sound.java file.
Thurs - Use a loop (for-each, while, or for) to have a turtle draw at least 10 triangles (you should be able to count all the triangles). Turtles know how to drop a picture and when they drop a picture it will be rotated to match the current turtle heading. Use a loop to drop at least 10 copies of a picture while turning the turtle. Turn in the Turtle.java file.
Friday - 08-Intro-Sound-part3.ppt. Add the normalize method to the Sound.java file and test it. Write a method to find and return the smallest value in a sound. Write the method forceToExtremes() and test it. Turn in the modified Sound.java file.
10th week (Oct 13-16th)
What is a while loop? How do you loop (iterate) as long as some Boolean expression is true? What is a list? How do you loop (iterate) through all items in a list?
Reading: Chapter 7
Tues- Finish the lab from last Thurs (read the following slides 07-AliceWhileLoop.ppt and finish the code for 07Chase.a2w - turn in the compeleted world). If you have
times also do the challenge with the frog and the ladybug.
07frogAndLadybugNoCode.a2w
Wed - Read the following slides 07-ListsAndIterationInAlice.ppt and have all of the dancers in 07Rockettes.a2w put down their legs one at a time, then have them all lift their leg at the same time, and then put them all down at the same time.
Thurs - Create a list in Alice and have all objects in the list do an action at the same time and also one at a time. Review for test ReviewSheet-2.doc.
Friday - Test
9th week (Oct 5-9th)
What is a complex conditional? How do you join conditionals? What is a counted loop? What is an infinite loop? What is a nested loop?
ComplexConditionalsInAlice.doc - Monday lab
06Zeus-V1.a2w
Reading: Chapter 7
07-ForLoopInAlice.ppt
07BunnyHop.a2w
07Carousel.a2w
07FerrisWheel.a2w
07LoopWithFunctionCall.a2w
ForLoopInAlice.doc - Tues lab
Wed - create an Alice animation with at least one for loop. If you have time also add a conditional and a function.
Thursday - read the following slides and finish the code for 07Chase.a2w - turn in the compeleted world
07-AliceWhileLoop.ppt
07Chase.a2w
8th week
What is a function in Alice? How do you create your own function in Alice? What is a conditional?
We didn't finish all the labs from chapter 5 yet so we will review what you have learned on Monday and then let you continue with Friday's lab. If any of you have finished Fridays lab you can create a movie poster for your Alice movie using what you learned in chapter 5 or you can create a comic panel (one picture with text).
Reading: Chapter 6
06-Functions and Conditionals in Alice.ppt
CreatingFunctionsInAlice.doc - Wednesday
06ToyballOverNet-V1.a2w
06ToyballRoll-V1.a2w
ConditionalsInAlice.doc - Thursday
7th week
What is a class method in Java? How do you invoke a class method in Java? How to declare object variables and primitive variables in Java? What are some string methods in Java? How do you add comments to Java methods? How do you use the Java API? How to use the Java API to do simple and complex drawing in Java? How does Java handle inheritance? What is an interface?
Reading: Chapter 5 in Exploring Wonderland: Java Programming Using Alice and Media Computation
Assignment: Create a movie poster for an Alice movie using the drawing methods in Java.
Java Documentation is at http://java.sun.com/javase/6/docs/api/
05-Drawing-Turtle-and-AWT.ppt
PicturesStringsAndDrawingLab.doc - Monday
UsingGraphicsLab.doc - Thursday
DrawingStringsLab.doc - Wednesday
AdvancedDrawingLab.doc - Friday
6th week
Since we didn't have Java and DrJava installed last week we are a bit behind. We will cover the rest of the material from week 5 this week and also do an introduction to GridWorld. There will be a test on Friday. The test will cover everything you have learned so far: program, algorithm, sequential execution, parallel execution, number systems and conversions between number systems, creating methods in Alice, adding parameters to methods in Alice, declaring variables in Java, creating methods in Java, adding parameters to methods in Java, the main method, and part 1 of GridWorld.
Reading: Chapter 4 in Exploring Wonderland.
Reading: Part 1 in the student manual for GridWorld. The GridWorld student manual is at http://apcentral.collegeboard.com/apc/public/courses/teachers_corner/151155.html
04-Intro-Object-Oriented-In-Java.ppt
IntroWorldTurtleLab.doc Monday lab
JavaMethodsLabv2.doc Tues lab
GridWorldPart1.doc Wed lab
ReviewSheet-1.doc for the test on Friday
In the fifth week we will finish the presetations of the group Alice projects and then start the transition to Java. There is a short lab on Java on Tuesday (teachers can get the lab on the Tea Party website). On Wed there will be a lecture/lab on creating objects in Java and how to invoke methods in Java (slides 1-25). On Thursday each student will need to use the turtles to draw his or her initials (see slide 26-28). On Friday there will be a lecture/lab on creating methods in Java and passing parameters to methods in Java (slides 29-end). See http://home.cc.gatech.edu/TeaParty/43 for installation instructions for Java, DrJava, and Media Comptuation. You can also try out Java code at http://sandbox.fangengine.org/index.php/Console
Reading: Chapter 4 in Exploring Wonderland.
04-Intro-Object-Oriented-In-Java.ppt
In the fourth week will we review the test from Wed and the students will continue to work in groups on their Alice movies. The movies are due Wed and each team will present what they have been doing and answer questions from the class. On Friday we will have an introduction to Java and get DrJava set-up for next week.
Reading: Appendix A, Chapter 1-3 in Exploring Wonderland: Java Programming Using Alice and Media Computation
The third week the main questions are: How do you convert binary to octal or hex? How do you convert from octal or hex to binary? What is a storyboard? How do you turn a storyboard into a program? How do you work with subparts in Alice? How do you add comments to your Alice methods? We will have a test on Wed. On Tues we reviewed the number conversions and broke them into teams of 3 and they have to create a textual storyboard for their group project. The group project must have at least 2-3 subclasses that have at least 2 methods each. On Thursday they will work on the group project.
03-AnimationStoryboardToCode.ppt
BinaryOctalHex.doc
The second week the main questions are: What is object-oriented programming? What is a class? What is an object? How do you get objects to do something? What is a method? What is sequential execution? What is parallel execution? How do you create a method in Alice? How do you pass values to a method (parameters and arguments)? What is a subclass?
Here are the slides for this week. You should also read chapter 1 of the Alice book on google books. In lab on Tues and Thurs they will create Alice worlds. On Tues they will create an Alice world with at least 3 objects from 3 different classes and call at least 3 different methods. They should also use at least one Do Together. They should also try out the mouse controls for positioning an object. On Thursday they should work on creating at least two methods and passing at least two different values to the methods.
01-Intro-Object-Oriented-Prog-Alice.ppt
02-AliceBeyondBasics.ppt
The first week the main questions were: What is computer science? What do computer scientist do? What is a computer? What do computers understand? What is a binary number (CS Unplugged activity http://csunplugged.org/~csunplug/binary-numbers and counting with the fingers on one hand)? What is an algorithm? What is a program? What is a programming language?
Slides from first week Intro-Computers-Prog-Ch1-students.ppt
On-line game for practicing binary to decimal and decimal to binary http://forums.cisco.com/CertCom/game/binary_game_page.htm
Hexadecimal values for html colors are at http://www.webmonkey.com/reference/Color_Charts
More information on Octal is at http://en.wikipedia.org/wiki/Octal
More information on Hexadecimal is at http://en.wikipedia.org/wiki/Hexadecimal
In class quiz for number conversion with decimal, binary, octal, and hexadecimal.
http://uk1.hotpotatoes.net/ex/45273/HWIZRXBU.php
Here is a summary on how to do number conversions with decimal, binary, octal, and hexadecimal.
Number Conversions.doc