Difference between revisions of "AP Computer Science"

From WLCS
Line 4: Line 4:
 
* APCS FRQ 2019 #3 [https://apcentral.collegeboard.org/pdf/ap19-sg-computer-science-a.pdf grading rubric]
 
* APCS FRQ 2019 #3 [https://apcentral.collegeboard.org/pdf/ap19-sg-computer-science-a.pdf grading rubric]
 
** [https://apcentral.collegeboard.org/pdf/ap19-frq-computer-science-a.pdf #3 question]
 
** [https://apcentral.collegeboard.org/pdf/ap19-frq-computer-science-a.pdf #3 question]
 +
* Merge sort
 
* Quick...
 
* Quick...
 
*# Create a two dimensional array of type double (4 x 6)
 
*# Create a two dimensional array of type double (4 x 6)
Line 51: Line 52:
 
== Tuesday (3/3/20) ==
 
== Tuesday (3/3/20) ==
 
* Super Tuesday (no school for students)
 
* Super Tuesday (no school for students)
 
== Friday (2/28/20) ==
 
'''Agenda:'''
 
* Complete rubric grading of Question #1 from [https://apcentral.collegeboard.org/pdf/ap19-frq-computer-science-a.pdf 2019 AP CS FRQ]
 
* Introduction to Recursion
 
** [https://drive.google.com/open?id=1lTbHjY4I8bw4vWaXyoe-t5jDDTTCqa6ZcYR3BTyRNZc Recursion slides]
 
** mystery() multiple choice question
 
<syntaxhighlight lang="Java">
 
Consider the following recursive method.
 
public static int mystery(int n)
 
{
 
    if (n == 0)
 
        return 1;
 
    else
 
        return 3 * mystery(n - 1);
 
}
 
What value is returned as a result of the call mystery(5) ?
 
(a) 0
 
(b) 3
 
(c) 81
 
(d) 243
 
(e) 6561
 
</syntaxhighlight>
 
 
* Practice Free Response
 
** 22.5 minutes per question (90 minutes for 4 questions)
 
** Complete Question #2 from [https://apcentral.collegeboard.org/pdf/ap19-frq-computer-science-a.pdf 2019 AP CS FRQ]
 
** Rubric grade as a class
 
 
'''Homework:'''
 
* Complete eIMACS: Activity 13: Recursion
 
** You can review recursion concepts in the reading: Java Basics -> Methods -> Recursive Methods
 
* Complete repl.it: Recursion - Counting chars
 
* Complete repl.it: Recursion - Reverse String
 
 
== Wednesday (2/26/20) ==
 
'''Agenda:'''
 
* static keyword (for methods or for variables)
 
** binds the method or variable to the class NAME as opposed to the object instance
 
** static methods may *not* modify instance variables
 
** static method example
 
** static variable exists as a single copy for all objects
 
** static variable example
 
* final keyword
 
** makes the variable unchangeable
 
** final variable example
 
* Practice Free Response
 
** 22.5 minutes per question (90 minutes for 4 questions)
 
** Most questions have multiple parts
 
** Complete Question #1 from [https://apcentral.collegeboard.org/pdf/ap19-frq-computer-science-a.pdf 2019 AP CS FRQ]
 
** Rubric grading
 
 
== Monday (2/24/20) ==
 
'''Agenda:'''
 
* Review eIMACS: Test 14: Inheritance & Polymorphism
 
* Inheritance & Polymorphism Quiz
 
* Complete eIMACS: Activity 18: Components
 
 
== Thursday (2/20/20) ==
 
'''Warmup:'''
 
* Complete the Point class repl.it warmup
 
 
'''Agenda:'''
 
* Inheritance & Polymorphism Quiz on '''Monday (2/24/20)'''
 
* Inheritance review
 
** Used to create superclasses comprised of common attributes (instance variables) and behaviors (methods)
 
** extends keyword - subclasses inherit all things public from the super class (except for constructors)
 
** super() - method can be used to call any of the superclass's constructors (0 or more parameters can be used if it matches)
 
* Class Hierarchies
 
** A superclass reference variables can reference a subclass object
 
* Polymorphism - same method names but different ... (parameters or objects)
 
** Overriding methods - subclass method overriding superclass method of the same name
 
** ...casting may be necessary depending on your reference variable type
 
** Where else have we seen overriding methods?
 
* Object super class
 
** equals()
 
** toString()
 
* Animal class example
 
 
'''Homework:'''
 
* Complete eIMACS: Test 14: Inheritance & Polymorphism
 
 
== Tuesday (2/18/20) ==
 
'''Warmup:'''
 
* Complete the Circle class repl.it warmup
 
 
'''Agenda:'''
 
* Inheritance and Polymorphism
 
** Extending classes - extends keyword
 
** super() method call
 
** Complete Activity 17: Airplanes
 
* Demonstrate Employee and Company classes
 
 
== Thursday (2/13/20) ==
 
'''Agenda:'''
 
* Work on and complete the Employee & Company classes (specifications below)
 
** Prepare your own main() to demonstrate that everything works
 
** Classes should be completed as homework and over the long weekend
 
** Code will be submitted (details to come)
 
** Demonstrations will begin on Tuesday (2/18/20)
 
 
== Tuesday (2/11/20) ==
 
'''Agenda:'''
 
* NetBeans review
 
* Complete the ArrayList repl.its
 
** sum()
 
** min() & max()
 
* ArrayList<Card> examples
 
** Total the value of your hand
 
** Finding the smallest Card (minimum)
 
** Finding the largest Card (maximum)
 
** Finding a card (i.e. search)
 
** Sort your Cards
 
* Expectation: you should be able to repeat any of the above with any object!
 
* Employee class
 
** instance variables: (these should be private)
 
*** name (text)
 
*** experience (whole number years of experience)
 
*** salary (floating point number)
 
** methods (these should be public)
 
*** constructors (default and specific)
 
*** setters and getters (accessors and mutators) for all instance variables
 
*** String toString() - returns a String that represents the Employee (all the attributes)
 
* Company class
 
** instance variable:
 
*** ArrayList<Employee> employees
 
** methods (these should be public)
 
*** constructors (default and specific) - instantiate your ArrayList
 
*** void addEmployee(Employee e) - adds the Employee object e to your employees ArrayList
 
*** void listAllEmployees() - prints out all the employees
 
*** Employee getMostExperienced() - returns most experienced Employee
 
*** Employee getHighestPaid() - returns the highest paid Employee
 
*** Employee getLowestPaid() - returns the lowest paid Employee
 
*** double getSumOfSalaries() - returns the sum total of all the salaries in employees
 
*** void sortByYearsOfExperience() - sorts employees by years of experience
 
 
== Friday (2/7/20) ==
 
'''Agenda:'''
 
* ArrayList Quiz
 
* APS Robotics Day volunteers needed
 
** Saturday, February 8th from 8:30-12:30
 
** Career Center
 
* BrickBreaker w/ ArrayLists demos
 
* ArrayList<Card> examples
 
** Total the value of your hand
 
** Finding the smallest Card (minimum)
 
** Finding the largest Card (maximum)
 
** Finding a card (i.e. search)
 
** Sort your Cards
 
* Expectation: you should be able to repeat any of the above with any object!
 
 
== Wednesday (2/5/20) ==
 
'''Warmup:'''
 
# Write a Java program that creates an ArrayList<Double>
 
# Generate 100 random numbers (0 - 1000) and put them in your ArrayList
 
# Write a loop that finds the minimum and maximum values from your ArrayList
 
# Print them out
 
 
'''Agenda:'''
 
* ArrayList Quiz on '''Friday 2/7/20'''
 
* [https://repl.it/@paulbui/Card-Example Card example]
 
*# Create a new repl.it called ArrayList Card Practice
 
*# Create a new file within the repl.it named Card.java
 
*# Copy and paste Mr. Bui's incomplete Card.java file into yours
 
* public vs private
 
** examples
 
* ArrayList<Card> examples
 
** Total the value of your hand
 
** Finding the smallest Card (minimum)
 
** Finding the largest Card (maximum)
 
** Finding a card (i.e. search)
 
** Sort your Cards
 
* Expectation: you should be able to repeat any of the above with any object!
 
 
== Monday (2/3/20) ==
 
'''Agenda:'''
 
* ArrayList Quiz on '''Friday 2/7/20'''
 
* Minesweeper demos
 
* BrickBreaker w/ ArrayLists demos
 
* [https://apcentral.collegeboard.org/pdf/ap-computer-science-a-course-and-exam-description-0.pdf?course=ap-computer-science-a AP CS Guide]
 
** Review Unit 7: ArrayList's Essential Knowledge
 
* AP-expected algorithms:
 
** Min/Max
 
** Searching
 
*** Linear search
 
*** Binary search
 
** Sorting
 
*** Selection sort
 
*** Insertion sort
 
  
 
== [[APCS - 1920 - January]] ==
 
== [[APCS - 1920 - January]] ==

Revision as of 00:30, 9 March 2020

Monday (3/9/20)

Agenda:

  • Recursion quiz
  • APCS FRQ 2019 #3 grading rubric
  • Merge sort
  • Quick...
    1. Create a two dimensional array of type double (4 x 6)
    2. Populate the 2D array with random numbers from 0 to 100
    3. Write a nested for loop that sums the entire 2D array and calculates the average

Homework:

  • APCS FRQ 2019 #4 (22 minutes)

Thursday (3/5/20)

Warmup:

Given the following method declaration, which of the following is printed as the result of the call mystery(1234)?

//precondition:  x >=0
public static void mystery (int x)
{
   System.out.print(x % 10);

   if ((x / 10) != 0)
   {
      mystery(x / 10);
   }
   System.out.print(x % 10);
}

(a) 1441
(b) 43211234
(c) 3443
(d) 12344321
(e) Many digits are printed due to infinite recursion.

Agenda:

  • Finish APCS FRQ 2019 #2 (5 minutes)
    • Self-grade rubric
  • Recursion quiz on Monday (3/9/19)
  • Recursion review & HW questions?
  • Recursion practice problems
    • Write a recursive method that returns the sum of all the numbers from N down to 1: int sum(int N)
    • Write a recursive method that prints every other letter of a string: void printSkipping(String s)
    • Write a recursive method that returns true if a particular character is in the String: boolean findChar(char ch, String s)

Homework:

  • APCS FRQ 2019 #3 (22 minutes)

Tuesday (3/3/20)

  • Super Tuesday (no school for students)

APCS - 1920 - January

APCS - 1920 - December

APCS - 1920 - November

APCS - 1920 - October

APCS - 1920 - September

APCS - Archives