Difference between revisions of "AP Computer Science"

From WLCS
Line 1: Line 1:
 +
== Tuesday (3/5/19) ==
 +
* Confirm that you have completed Activity 19
 +
* Complete Test 15
 +
* Complete the [https://www.albert.io/assignment/d8da5c33-2eaf-4edf-b1ee-28410d733889 Albert.io Inheritance & Polymorphism assignment]
 +
 +
 
== Wednesday (2/27/19) ==
 
== Wednesday (2/27/19) ==
 
'''Agenda:'''
 
'''Agenda:'''

Revision as of 22:44, 4 March 2019

Tuesday (3/5/19)


Wednesday (2/27/19)

Agenda:

  • Activity 17 & 18 Questions?
  • Test 14 Questions?
  • Class hierarchies - Object class
    • Object class methods
  • Polymorphism review
    • Polymorphism & ArrayLists
  • Overriding methods
  • Complete Activity 19

Monday (2/25/19)

Agenda:

  • Inheritance Quiz in Canvas
    • Closed-book, closed-note, closed-person
  • Read and work through eIMACS: Object-oriented Programming -> Inheritance and Polymorphism -> Class Hierarchies (pages 218-224)
    • Most of this chapter will be review; however there is new material on pages 222-224
    • Pay attention to the reading about the Object class and its methods. For example: e.getClass().getName()
  • Complete eIMACS: Activity 18: Components
  • Read and work through eIMACS: Polymorphism
  • Complete Test 14

Homework:

  • eIMACS: Activity 18 (if not completed during class)
  • eIMACS: Test 14 (if not completed during class)

Thursday (2/21/19)

Agenda:

  • Don't forget...Activity 17: Airplanes was homework
  • More Inheritance Review & Practice
    • Media:OOP.pptx
    • Complete the Person/Teacher/Student/... inheritance exercise
    • Inheritance Quiz on Monday (2/25/19)
  • AP Java Subset

Tuesday (2/19/19)

Agenda:

  • Employee class & ArrayList assignment (complete < 20 minutes)
    1. Create an Employee class that has the following attributes:
      • String name
      • int employeeID
      • double salary
    2. Define setters and getters for all attributes
    3. Define the toString() method that returns the name and employee ID
    4. Within main()
      1. Create an ArrayList<Employee> and populate it with 5 different Employee objects
      2. Write a loop that finds the Employee that has the highest salary, and print out the Employee
  • Inheritance and Polymorphism
    • Extending our Employee class
    • Walk-through inheritance exercises
  • Complete Activity 17: Airplanes for homework

Homework:

  • Complete eIMACS: Activity 17: Airplanes

Thursday (2/14/19)

Agenda:

  • Complete and demo War

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