Difference between revisions of "AP Computer Science"

From WLCS
(64 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Friday (11/30/18) ==
+
== Tuesday (2/12/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Search & Sort Identification Quiz
+
* Class construction, object usage, & object arrays quiz
* for loop demos - Practice 1 & 2
+
* Complete and demo War Card "Game"/Simulation
* Complete for Loop assignments in Repl.it
+
** Display how many cards each player has at the beginning of each round
** Count Words
+
** You should display messages like "Player 1 reveals X of X"
** double[] Average
+
** Display a message of who wins each "round"
** Reverse String Print
+
** Display "I declare war!"
* Introduction to Methods
+
** Display the eventual winner
** [https://docs.google.com/presentation/d/1L-tbBp51YuUoTWldXFBr6JGcyHF5sBy_flfPGiqlVAQ/edit?usp=sharing Java Methods slides]
 
** Java methods examples
 
** Complete repl.it methods assignments
 
  
== Monday - Wednesday (11/26/18 - 11/28/18) ==
+
== Wednesday - Friday (2/6/19 - 2/8/19) ==
'''Warmup:'''
+
'''Agenda:'''
* Write a program that takes a String input, uses a for loop, and prints every other letter in the string
+
* Complete and submit Poker Hands: Part 1 to repl.it
 +
* 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) ==
 +
'''Agenda:'''
 +
* Demo Item Collection Game w/ Object Arrays
 +
* Complete Card class in repl.it (should be done today)
 +
* Work on Poker Hands: Part 1 in repl.it - '''due Thursday (2/6/19)'''
  
 +
== Thursday (1/31/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* for loop demos - Practice 1:
+
* Demo Item Collection Game
*# Monte Carlo Pi
+
* Arrays of Objects
*# Taylor Series Pi and e
+
** String arrays (review)
*# Looping exercises
+
** Ball class and Ball array
* for loop demos - Practice 2:
+
* Item Collection Game w/ Object Arrays (assignment)
*# Linear search
+
*# Copy your Item Collection Game to a new Processing sketch
*# Binary search
+
*# Convert your item Sprites collected into an array
*# Selection sort
+
*# Convert your robot Sprites into an array
*# Bubble sort
+
*# Demo your converted game on '''Monday (2/4/19)'''
*# Insertion sort
 
* Complete for Loop assignments in Repl.it
 
** Count Words
 
** double[] Average
 
** Reverse String Print
 
* Search & Sort Identification Quiz next class
 
** If shown the programming code or visualization of a particular algorithm, you can identify its name
 
** You may be shown code or visualizations of things that you have not yet learned! You must be able to say that you did not learn it yet
 
  
== Monday (11/19/18) ==
+
== Tuesday (1/29/19) ==
'''Warmup:'''
+
'''Agenda:'''
* for loops quiz at the end of class
+
* Item Collection Game - '''due Thursday (1/31/19)'''
* Prepare to demo for looped version of:
+
*# We will design a simple top-down item collection game using a new Sprite class (specified below)
*# Monte Carlo Pi
+
*# Find and download Sprite images of your choosing
*# Taylor Series Pi and e
+
*# You can move the player sprite with the keyboard (wrap the player to the other side of the screen if you go off screen)
*# Looping exercises
+
*# The player sprite will be able to collect item sprites
 +
*# Robot sprites will follow the player around
 +
*# You win when you collect all the items
 +
*# You lose if a robot collides with your sprite
 +
* Sprite class (has similarities to the previous Sprite class)
 +
** 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) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Repl.it resubmits
+
* [https://drive.google.com/file/d/1tQc3yOyfjy7xN6oz0glIeFHqJgORmuAd/view?usp=sharing Dino Game example]
** Binary search incorrect -- please redo and resubmit
+
** We will convert the non-OOP version into an [https://drive.google.com/file/d/1FAO7kdtVrYrrO4jgcRMap3S3UtDqFe_W/view?usp=sharing OOP version]
* for Loop Practice 2 - Re-implement the following using for loops:
+
** Add another cactus to the dino game
** Linear search
+
* Flappy Bird OOP
** Binary search
+
** What modifications to our Sprite class do we need to make?
** Selection sort
+
** Here are some Flappy Bird sprite images [https://drive.google.com/file/d/1UugFrLPjeA8YPXOlmOxjIvzd6HdvpupA/view?usp=sharing here]
** Bubble sort
+
** Implement the OOP version of Flappy Bird in Processing
** Insertion sort
+
** Bird will need to flap when a key is pressed
* for loop assignments (repl.it submissions coming...)
+
** Pipes will need to move and wrap around the screen
*# Write a program that takes a String input, uses a for loop, counts and displays the total number of spaces
+
** Score increases when a pipe is passed (this will require something to be added to the Sprite class)
*# Write a program that takes a double[], uses a for loop, and displays the average value of all elements in the array
+
** Lose when bird collides with a pipe or when the Bird goes too far below the screen
*# Write a program that takes a String input, and displays the entire string reversed (on one line)
+
** Due '''Thursday (1/24/19)''' -- last assignment of 2nd Quarter
* Have a great Thanksgiving Break!
 
  
== Thursday (11/15/18) ==
+
== Thursday (1/17/19) ==
 
'''Warmup:'''
 
'''Warmup:'''
* Login to your [https://www.albert.io albert.io] account
+
* Submit your Circle class to repl.it
* Join our AP CS A course using: EMVT7IN8APTL
 
  
 
'''Agenda:'''
 
'''Agenda:'''
* Java for loops (eIMACS: For Loops)
+
* Object-Oriented Programming cont'd
*# Write a for loop that prints out 0 to 10 (exclusive)
+
** OOP Review - attributes, constructors, setters, getters, public vs. private, this
*# Write a for loop that prints out 100 to 50 (inclusive)
+
** toString() method (using the Point class)
*# Write a for loop that prints out the first 10 odd numbers
+
** Submit Point class to repl.it
* for Loop Practice 1 - Convert the following programs from a while loop to a for loop (due '''Monday (11/19/18)''')
+
** [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
*# Monte Carlo Pi
+
* Complete the Car class assignments in repl.it
*# Taylor Series Pi and e
+
* [https://drive.google.com/file/d/1tQc3yOyfjy7xN6oz0glIeFHqJgORmuAd/view?usp=sharing Dino Game example]
*# Looping exercises
+
** Add another cactus to the dino game
  
== Tuesday (11/13/18) ==
+
'''Homework:'''
 +
* Complete eIMACS: Activity 14: Address Objects
 +
 
 +
== Tuesday (1/15/19) ==
 +
* Snow Day
 +
 
 +
== Friday (1/11/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Bubble sort questions?
+
* Object-Oriented Programming cont'd
** Bubble sort should be done by now
+
** Person class review
* NetBeans installation check
+
** Vocab:
* JGrasp installation check
+
*** class vs object
* JGrasp canvas visualization practice
+
*** declaration vs instantiation
** Simple variables
+
** Point class example
** Array
+
** Point object instantiation
** Loop
+
** Point object usage
* Insertion Sort Assignment
+
** [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
*# Study the insertion sort visualization [https://visualgo.net/bn/sorting VisuAlgo]
+
** Circle class example
*# What are the major components of the algorithm? (e.g. Loop that iterates through array from beginning to end) Others?
+
** [https://drive.google.com/file/d/1tQc3yOyfjy7xN6oz0glIeFHqJgORmuAd/view?usp=sharing Dino Game example]
*# Implement insertion sort
 
*# Create your own data set and demonstrate your code for credit. Be prepared to be able to explain how your code works
 
*# Submit you code via Repl.it
 
  
== Wednesday (11/8/18) ==
+
'''Homework:'''
 +
* Create a Circle class and test it out
 +
* Follow the [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
 +
 
 +
== Wednesday (1/9/19) ==
 
'''Agenda:'''
 
'''Agenda:'''
* Selection sort assignment in repl.it should be already complete
+
* Cornell Engineering Diversity Programs - one-week residential programs:
* Watch the bubble sort visualization at [https://visualgo.net/bn/sorting VisuAlgo]
+
** [https://sites.coecis.cornell.edu/catalystacademy/ Catalyst Academy] - juniors and seniors from underrepresented backgrounds
** Watch it multiple times until you have a firm understanding of what is happening
+
** [https://sites.coecis.cornell.edu/curieacademy/ Curie Academy] - high school girls who excel in math and science
** You can also read slide 5 about bubble sort in the [https://docs.google.com/presentation/d/1Y5JOINM2w744nqimZf2iVuFpi6N6gM2B7GM4ArGjChQ/edit?usp=sharing Sorting slides]
+
* Recursion quiz
* There is a bubble sort repl.it assignment posted with guided comments. Implement bubble sort using the guided comments. You can copy-paste the comments into NetBeans to develop your code. Be sure to submit your finalized code into repl.it for bubble sort
+
* Submit Recursion Problems to repl.it
* Future assignments will implement insertion sort and merge sort algorithms. You are encouraged to watch the [https://visualgo.net/bn/sorting VisuAlgo] visualizations to understand those algorithms
+
** 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)
 +
* Introduction to Object-Oriented Programming
 +
** [https://repl.it/@paulbui/SimpleProgramWithoutOOP Simple program without OOP example]
 +
** Simple program with OOP example
 +
** 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
  
== Monday (11/5/18) ==
+
'''Homework:'''
'''Warmup:'''
+
* Complete and submit recursion problems to repl.it
# Assume you have a given int[] named arr
+
* Review SimpleProgramWithOOP notes that we did in class
# Assume you have two int variables named a and b
 
# Write the code that would swap the elements in arr located at indices a and b
 
#* e.g. swap the elements arr[a] and arr[b]
 
  
'''Agenda:'''
+
== Monday (1/7/19) ==
* Complete the Find Minimum & Maximum repl.it
+
* Don't forget to complete Activity 13 (due tonight)
* Group sorting activity
+
* Recursion Quiz Wednesday (1/9/19)
*# Form 3-4 person groups
+
** Multiple choice questions
*# Receive playing cards
+
** Free-response question(s)
*# With your group, document step-by-step an algorithm (steps) of how you sort the cards out
+
* Recursion Review & Practice
*# Every group will share their algorithm in class
+
* Recursion Problems (prepare to submit to repl.it)
*# Paste your sorting algorithm in this [https://docs.google.com/document/d/1Jh9Uz3FdomH2cB9VKUSTfL_BSluWEoROHmhwbpM_qaA/edit?usp=sharing group document] - Don't forget to put your names
+
** public static int count(String s, String ch) - returns the number of occurrences of ch (single character string) within s
* Introduction to Sorting
+
** public static String reverse(String s) - returns the reversed String s
** [https://docs.google.com/presentation/d/1Y5JOINM2w744nqimZf2iVuFpi6N6gM2B7GM4ArGjChQ/edit?usp=sharing Sorting slides]
+
** public static int reverse(int i) - returns an int that is the full digit reversal of i (e.g. 1234 -> 4321)
* Complete Selection sort assignment in repl.it
 
  
== Thursday (11/1/18) ==
+
== Monday - Friday (12/31/18 - 1/4/19) ==
* While loops quiz
+
* Winter Break
* [https://docs.google.com/presentation/d/1GLpwZbqLcyix2WHqS9lLJT3qCeIeWGQ9UDwr6f9VgoE/edit?usp=sharing Search slides]
 
** Linear Search
 
** Binary Search
 
* LS and BS assignments will be posted in Repl.it
 
* Complete LS and BS by Monday (11/5/18)
 
  
 
== Archives ==
 
== Archives ==
 +
* [[APCS - 1819 - December]]
 +
* [[APCS - 1819 - November]]
 
* [[APCS - 1819 - October]]
 
* [[APCS - 1819 - October]]
 
* [[APCS - 1819 - September]]
 
* [[APCS - 1819 - September]]
 
* [[APCS - 1718]]
 
* [[APCS - 1718]]
 
* [[APCS - 1516]]
 
* [[APCS - 1516]]

Revision as of 07:03, 12 February 2019

Tuesday (2/12/19)

Agenda:

  • Class construction, object usage, & object arrays quiz
  • Complete and demo War Card "Game"/Simulation
    • Display how many cards each player has at the beginning of each round
    • You should display messages like "Player 1 reveals X of X"
    • Display a message of who wins each "round"
    • Display "I declare war!"
    • Display the eventual winner

Wednesday - Friday (2/6/19 - 2/8/19)

Agenda:

  • Complete and submit Poker Hands: Part 1 to repl.it
  • 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
    1. Re-implement your Item Collection game so that it uses ArrayLists instead of arrays
    2. Start with an ArrayList of 1 robot, and add new robots every 3 seconds
    3. Start with an ArrayList of 5 items, and remove items when the player collides with them
  • ArrayList<Card> examples
  • War Card "Game"/Simulation
    1. Use NetBeans and create a new project for War
    2. The Main.java file will be the simulation
    3. Create a new Java class (name the file Card.java) and paste your Card class there
    4. Design and implement the game/simulation (we will design as a class)

Monday (2/4/19)

Agenda:

  • Demo Item Collection Game w/ Object Arrays
  • Complete Card class in repl.it (should be done today)
  • Work on Poker Hands: Part 1 in repl.it - due Thursday (2/6/19)

Thursday (1/31/19)

Agenda:

  • Demo Item Collection Game
  • Arrays of Objects
    • String arrays (review)
    • Ball class and Ball array
  • Item Collection Game w/ Object Arrays (assignment)
    1. Copy your Item Collection Game to a new Processing sketch
    2. Convert your item Sprites collected into an array
    3. Convert your robot Sprites into an array
    4. Demo your converted game on Monday (2/4/19)

Tuesday (1/29/19)

Agenda:

  • Item Collection Game - due Thursday (1/31/19)
    1. We will design a simple top-down item collection game using a new Sprite class (specified below)
    2. Find and download Sprite images of your choosing
    3. You can move the player sprite with the keyboard (wrap the player to the other side of the screen if you go off screen)
    4. The player sprite will be able to collect item sprites
    5. Robot sprites will follow the player around
    6. You win when you collect all the items
    7. You lose if a robot collides with your sprite
  • Sprite class (has similarities to the previous Sprite class)
    • 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)

Agenda:

  • Dino Game example
    • We will convert the non-OOP version into an 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 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

Agenda:

  • Object-Oriented Programming cont'd
    • OOP Review - attributes, constructors, setters, getters, public vs. private, this
    • toString() method (using the Point class)
    • Submit Point class to repl.it
    • Classes (Java) slides
  • Complete the Car class assignments in repl.it
  • Dino Game example
    • Add another cactus to the dino game

Homework:

  • Complete eIMACS: Activity 14: Address Objects

Tuesday (1/15/19)

  • Snow Day

Friday (1/11/19)

Agenda:

  • Object-Oriented Programming cont'd
    • Person class review
    • Vocab:
      • class vs object
      • declaration vs instantiation
    • Point class example
    • Point object instantiation
    • Point object usage
    • Classes (Java) slides
    • Circle class example
    • Dino Game example

Homework:

Wednesday (1/9/19)

Agenda:

  • Cornell Engineering Diversity Programs - one-week residential programs:
  • Recursion quiz
  • Submit Recursion Problems 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)
  • Introduction to Object-Oriented Programming

Homework:

  • Complete and submit recursion problems to repl.it
  • Review SimpleProgramWithOOP notes that we did in class

Monday (1/7/19)

  • 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