Difference between revisions of "AP Computer Science"

From WLCS
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Tuesday (2/12/19) ==
+
== Monday (3/25/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Class construction, object usage, & object arrays quiz
+
* FRQ #4 HQ check
* Complete and demo War Card "Game"/Simulation
+
* Questions about your self-grading FRQ #3?
 +
* [https://www.processing.org/tutorials/pixels/ Processing: Images & Pixels Tutorial]
 +
* Processing Image Two-Dimensional Array practice
 +
*# Convert to black and white
 +
*# Flip vertical
 +
*# Flip horizontal
 +
*# Rotate image 90 degrees of a square image
 +
*# Rotate 90 degrees clockwise of a non-square image (no animation needed)
 +
*# Mosaic (no animation needed)
 +
*## Take an image, sample every (10th row, 10th col) pixel's color
 +
*## Draw a 10x10 square using the sampled pixel's color at ever 10th (x,y)
 +
*## You should display both the original image and its mosaic
 +
*# Pointilism Animation
 +
*## This will be an animation
 +
*## Within setup(), load an image, load its pixels, and turn off line strokes
 +
*## Within draw(), generate a random index number from 0 to image's pixel length (use [https://processing.org/reference/random_.html random()])
 +
*##* int rand = (int) random(0, img.pixels.length);
 +
*## Sample the color of the pixel from the random index and fill with the color
 +
*## Calculate the appropriate (x,y) from the random index (Hint: use modulus (%) for x and division (/) for y)
 +
*## Draw the circle at its appropriate (x,y) using a random diameter from (5, 15)
  
== Wednesday - Friday (2/6/19 - 2/8/19) ==
+
'''Homework:'''
'''Agenda:'''
+
* Complete [https://apcentral.collegeboard.org/pdf/ap-computer-science-a-frq-2017.pdf 2017 APCS FRQ] by Friday (3/29/19)
* Complete and submit Poker Hands: Part 1 to repl.it
+
** Do not spend more than 1 hr 30 minutes (avg 22.5 mins per question)
* Introduction to ArrayLists
 
** AP CS reference card for ArrayLists
 
** eIMACS ArrayLists chapter review
 
** Memorize / study ArrayList<E> instance methods
 
* Processing - Ball example w/ ArrayLists
 
* Processing - millis() timer example
 
* Item Collection w/ ArrayLists
 
*# Re-implement your Item Collection game so that it uses ArrayLists instead of arrays
 
*# Start with an ArrayList of 1 robot, and add new robots every 3 seconds
 
*# Start with an ArrayList of 5 items, and remove items when the player collides with them
 
* ArrayList<Card> examples
 
* War Card "Game"/Simulation
 
*# Use NetBeans and create a new project for War
 
*# The Main.java file will be the simulation
 
*# Create a new Java class (name the file Card.java) and paste your Card class there
 
*# Design and implement the game/simulation (we will design as a class)
 
  
== Monday (2/4/19) ==
+
== Thursday (3/21/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Demo Item Collection Game w/ Object Arrays
+
* FRQ #3 HW check
* Complete Card class in repl.it (should be done today)
+
* Grade FRQ #3
* Work on Poker Hands: Part 1 in repl.it - '''due Thursday (2/6/19)'''
+
* Discussion: How do you study for a comprehensive exam?
 +
* Two-Dimensional Arrays review
 +
** array[ROW][COL]
 +
** instantiation & creation
 +
** row and col bounds
 +
** traversal / iteration through
 +
** Tic-Tac-Toe example
 +
** Image processing example(s)
  
== Thursday (1/31/19) ==
+
'''Homework:'''
'''Agenda:'''
+
* Complete 2018 FRQ #4 '''and''' self-score using the scoring guidelines
* Demo Item Collection Game
+
** [https://apcentral.collegeboard.org/pdf/ap18-frq-computer-science-a.pdf 2018 APCS FRQs]
* Arrays of Objects
+
** [https://secure-media.collegeboard.org/ap/pdf/ap18-sg-comp-sci-a.pdf 2018 APCS FRQ Scoring Guidelines]
** String arrays (review)
 
** Ball class and Ball array
 
* Item Collection Game w/ Object Arrays (assignment)
 
*# Copy your Item Collection Game to a new Processing sketch
 
*# Convert your item Sprites collected into an array
 
*# Convert your robot Sprites into an array
 
*# Demo your converted game on '''Monday (2/4/19)'''
 
  
== Tuesday (1/29/19) ==
+
== Tuesday (3/19/20) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Item Collection Game - '''due Thursday (1/31/19)'''
+
* Grade 2018 FRQ #2
*# We will design a simple top-down item collection game using a new Sprite class (specified below)
+
* [https://docs.oracle.com/javase/tutorial/java/concepts/interface.html Interfaces]
*# Find and download Sprite images of your choosing
+
** Real-world interface examples (mouse, keyboard, num pad, calculator, head phones, etc)
*# You can move the player sprite with the keyboard (wrap the player to the other side of the screen if you go off screen)
+
** '''interface''' and '''implements''' keywordS
*# The player sprite will be able to collect item sprites
+
*# Interfaces do not have instance variables (you can have static final variables)
*# Robot sprites will follow the player around
+
*# Interfaces only contain method signatures (no method bodies or implementations)
*# You win when you collect all the items
+
*# Classes can '''implement''' multiple interfaces
*# You lose if a robot collides with your sprite
+
*# Implementing an interface requires "implementing" the methods of the interface
* Sprite class (has similarities to the previous Sprite class)
+
* Interface example walk-through
** Attributes:  
 
*** double x, y (to be used for position)
 
*** double dx, dy (to be used for step size when moving -- always positive)
 
*** PImage img (stores the image)
 
*** boolean visible (default setting is true -- we will use this variable to track the Sprite's visibility state)
 
** Constructors:
 
*** Sprite()
 
*** Sprite(String imgfile, double x, double y, double dx, double dy)
 
** Methods:
 
*** void display() - if visible is true, then display the image
 
*** void moveLeft() - move x-coordinate to the left by dx amount
 
*** void moveRight() - move x-coordinate to the right by dx amount
 
*** void moveUp() - move y-coodrinate upwards by dy amount
 
*** void moveDown() - move y-coodrinate downwards by dy amount
 
*** boolean checkCollision(Sprite other) - returns true if this Sprite is colliding with the other Sprite (use previous Sprite class to help with this method)
 
*** void follow(Sprite other) - compare x and y coordinates of this Sprite with the other Sprite -- move this Sprite towards other Sprite by using the move____() methods
 
  
== Tuesday - Thursday (1/22/19 - 1/24/19) ==
+
'''Homework:'''
'''Agenda:'''
+
* Complete 2018 FRQ #3 within 22.5 minutes
* [https://drive.google.com/file/d/1tQc3yOyfjy7xN6oz0glIeFHqJgORmuAd/view?usp=sharing Dino Game example]
+
** [https://apcentral.collegeboard.org/pdf/ap18-frq-computer-science-a.pdf 2018 APCS FRQs]
** We will convert the non-OOP version into an [https://drive.google.com/file/d/1FAO7kdtVrYrrO4jgcRMap3S3UtDqFe_W/view?usp=sharing OOP version]
 
** Add another cactus to the dino game
 
* Flappy Bird OOP
 
** What modifications to our Sprite class do we need to make?
 
** Here are some Flappy Bird sprite images [https://drive.google.com/file/d/1UugFrLPjeA8YPXOlmOxjIvzd6HdvpupA/view?usp=sharing here]
 
** Implement the OOP version of Flappy Bird in Processing
 
** Bird will need to flap when a key is pressed
 
** Pipes will need to move and wrap around the screen
 
** Score increases when a pipe is passed (this will require something to be added to the Sprite class)
 
** Lose when bird collides with a pipe or when the Bird goes too far below the screen
 
** Due '''Thursday (1/24/19)''' -- last assignment of 2nd Quarter
 
 
 
== Thursday (1/17/19) ==
 
'''Warmup:'''
 
* Submit your Circle class to repl.it
 
  
 +
== Friday (3/15/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Object-Oriented Programming cont'd
+
* Free-response question rubric & grading
** OOP Review - attributes, constructors, setters, getters, public vs. private, this
+
* Abstract classes review
** toString() method (using the Point class)
+
* Complete Activity 24: Transactions
** Submit Point class to repl.it
 
** [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
 
* Complete the Car class assignments in repl.it
 
* [https://drive.google.com/file/d/1tQc3yOyfjy7xN6oz0glIeFHqJgORmuAd/view?usp=sharing Dino Game example]
 
** Add another cactus to the dino game
 
  
 
'''Homework:'''
 
'''Homework:'''
* Complete eIMACS: Activity 14: Address Objects
+
* Complete FRQ #2 within 22.5 minutes
 +
** [https://apcentral.collegeboard.org/pdf/ap18-frq-computer-science-a.pdf 2018 APCS FRQs]
  
== Tuesday (1/15/19) ==
+
== Wednesday (3/13/19) ==
* Snow Day
+
'''Warmup:'''
 +
* Hand-written free-response question (22 minutes)
 +
*# Read through all their given code and summary
 +
*# Every variable and method...
 +
*## What is the purpose of that variable or method?
 +
*## What are the input parameters of the method?
 +
*## What is returned by the method?
 +
*# WHEN READING...DO NOT FIXATE ON WRITING CODE
  
== Friday (1/11/19) ==
 
 
'''Agenda:'''
 
'''Agenda:'''
* Object-Oriented Programming cont'd
+
* Free-response question rubric & grading
** Person class review
 
** Vocab:
 
*** class vs object
 
*** declaration vs instantiation
 
** Point class example
 
** Point object instantiation
 
** Point object usage
 
** [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
 
** Circle class example
 
** [https://drive.google.com/file/d/1tQc3yOyfjy7xN6oz0glIeFHqJgORmuAd/view?usp=sharing Dino Game example]
 
  
'''Homework:'''
+
== Monday (3/11/19) ==
* Create a Circle class and test it out
+
* English 11 Writing SOL - no class
* Follow the [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
 
  
== Wednesday (1/9/19) ==
+
== Thursday (3/7/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Cornell Engineering Diversity Programs - one-week residential programs:
+
* Confirm that you have completed the [https://www.albert.io/assignment/d8da5c33-2eaf-4edf-b1ee-28410d733889 Albert.io Inheritance & Polymorphism assignment]
** [https://sites.coecis.cornell.edu/catalystacademy/ Catalyst Academy] - juniors and seniors from underrepresented backgrounds
+
** Questions?
** [https://sites.coecis.cornell.edu/curieacademy/ Curie Academy] - high school girls who excel in math and science
+
* Method overriding review & example
* Recursion quiz
+
* Complete eIMACS: Lab 4: Inventory Tracking
* Submit Recursion Problems to repl.it
+
* static keyword (for methods or for variables)
** public static int count(String s, String ch) - returns the number of occurrences of ch (single character string) within s
+
** binds the method or variable to the class NAME as opposed to the object instance
** public static String reverse(String s) - returns the reversed String s
+
** static method example
** public static int reverse(int i) - returns an int that is the full digit reversal of i (e.g. 1234 -> 4321)
+
** static variable example
* Introduction to Object-Oriented Programming
+
* final keyword
** [https://repl.it/@paulbui/SimpleProgramWithoutOOP Simple program without OOP example]
+
** makes the variable unchangeable
** Simple program with OOP example
+
** final variable example
** Point class example
+
* abstract keyword
** Point object instantiation
+
** Abstract classes walk-through (Animal->Mammal, Fish, Bird)
** Point object usage
+
** Object instances of abstract classes are *not* allowed
** [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
+
** Derived sub-classes of abstract classes must implement abstract methods (unless the sub-class is also abstract)
** Circle class example
 
  
'''Homework:'''
+
== Tuesday (3/5/19) ==
* Complete and submit recursion problems to repl.it
+
'''Agenda:'''
* Review SimpleProgramWithOOP notes that we did in class
+
* Confirm that you have completed Activity 19
 
+
* Complete the [https://www.albert.io/assignment/d8da5c33-2eaf-4edf-b1ee-28410d733889 Albert.io Inheritance & Polymorphism assignment]
== Monday (1/7/19) ==
+
* Complete eIMACS: Lab 4: Inventory Tracking
* Don't forget to complete Activity 13 (due tonight)
 
* Recursion Quiz Wednesday (1/9/19)
 
** Multiple choice questions
 
** Free-response question(s)
 
* Recursion Review & Practice
 
* Recursion Problems (prepare to submit to repl.it)
 
** public static int count(String s, String ch) - returns the number of occurrences of ch (single character string) within s
 
** public static String reverse(String s) - returns the reversed String s
 
** public static int reverse(int i) - returns an int that is the full digit reversal of i (e.g. 1234 -> 4321)
 
 
 
== Monday - Friday (12/31/18 - 1/4/19) ==
 
* Winter Break
 
  
 
== Archives ==
 
== Archives ==
 +
* [[APCS - 1819 - February]]
 +
* [[APCS - 1819 - January]]
 
* [[APCS - 1819 - December]]
 
* [[APCS - 1819 - December]]
 
* [[APCS - 1819 - November]]
 
* [[APCS - 1819 - November]]

Revision as of 18:43, 24 March 2019

Monday (3/25/19)

Agenda:

  • FRQ #4 HQ check
  • Questions about your self-grading FRQ #3?
  • Processing: Images & Pixels Tutorial
  • Processing Image Two-Dimensional Array practice
    1. Convert to black and white
    2. Flip vertical
    3. Flip horizontal
    4. Rotate image 90 degrees of a square image
    5. Rotate 90 degrees clockwise of a non-square image (no animation needed)
    6. Mosaic (no animation needed)
      1. Take an image, sample every (10th row, 10th col) pixel's color
      2. Draw a 10x10 square using the sampled pixel's color at ever 10th (x,y)
      3. You should display both the original image and its mosaic
    7. Pointilism Animation
      1. This will be an animation
      2. Within setup(), load an image, load its pixels, and turn off line strokes
      3. Within draw(), generate a random index number from 0 to image's pixel length (use random())
        • int rand = (int) random(0, img.pixels.length);
      4. Sample the color of the pixel from the random index and fill with the color
      5. Calculate the appropriate (x,y) from the random index (Hint: use modulus (%) for x and division (/) for y)
      6. Draw the circle at its appropriate (x,y) using a random diameter from (5, 15)

Homework:

  • Complete 2017 APCS FRQ by Friday (3/29/19)
    • Do not spend more than 1 hr 30 minutes (avg 22.5 mins per question)

Thursday (3/21/19)

Agenda:

  • FRQ #3 HW check
  • Grade FRQ #3
  • Discussion: How do you study for a comprehensive exam?
  • Two-Dimensional Arrays review
    • array[ROW][COL]
    • instantiation & creation
    • row and col bounds
    • traversal / iteration through
    • Tic-Tac-Toe example
    • Image processing example(s)

Homework:

Tuesday (3/19/20)

Agenda:

  • Grade 2018 FRQ #2
  • Interfaces
    • Real-world interface examples (mouse, keyboard, num pad, calculator, head phones, etc)
    • interface and implements keywordS
    1. Interfaces do not have instance variables (you can have static final variables)
    2. Interfaces only contain method signatures (no method bodies or implementations)
    3. Classes can implement multiple interfaces
    4. Implementing an interface requires "implementing" the methods of the interface
  • Interface example walk-through

Homework:

Friday (3/15/19)

Agenda:

  • Free-response question rubric & grading
  • Abstract classes review
  • Complete Activity 24: Transactions

Homework:

Wednesday (3/13/19)

Warmup:

  • Hand-written free-response question (22 minutes)
    1. Read through all their given code and summary
    2. Every variable and method...
      1. What is the purpose of that variable or method?
      2. What are the input parameters of the method?
      3. What is returned by the method?
    3. WHEN READING...DO NOT FIXATE ON WRITING CODE

Agenda:

  • Free-response question rubric & grading

Monday (3/11/19)

  • English 11 Writing SOL - no class

Thursday (3/7/19)

Agenda:

  • Confirm that you have completed the Albert.io Inheritance & Polymorphism assignment
    • Questions?
  • Method overriding review & example
  • Complete eIMACS: Lab 4: Inventory Tracking
  • static keyword (for methods or for variables)
    • binds the method or variable to the class NAME as opposed to the object instance
    • static method example
    • static variable example
  • final keyword
    • makes the variable unchangeable
    • final variable example
  • abstract keyword
    • Abstract classes walk-through (Animal->Mammal, Fish, Bird)
    • Object instances of abstract classes are *not* allowed
    • Derived sub-classes of abstract classes must implement abstract methods (unless the sub-class is also abstract)

Tuesday (3/5/19)

Agenda:

Archives