Difference between revisions of "AP Computer Science"
From WLCS
Line 1: | Line 1: | ||
− | == Tuesday (12/18/18) == | + | == Tuesday - Thursday (12/18/18 - 12/20/18) == |
'''Agenda:''' | '''Agenda:''' | ||
* Introduction to Recursion | * Introduction to Recursion | ||
Line 8: | Line 8: | ||
**# Write a recursive method that returns true if a particular character is in the String: boolean findChar(char ch, String s) | **# Write a recursive method that returns true if a particular character is in the String: boolean findChar(char ch, String s) | ||
* Complete Activity 13 | * Complete Activity 13 | ||
+ | * Recursion Practice Examples - We will convert the following from iterative to recursive algorithms | ||
+ | *# Monte Carlo Pi | ||
+ | *# Taylor Series Pi and e | ||
+ | *# Looping exercises | ||
+ | *# ...and more 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) | ||
== Friday (12/14/18) == | == Friday (12/14/18) == |
Revision as of 09:19, 20 December 2018
Contents
- 1 Tuesday - Thursday (12/18/18 - 12/20/18)
- 2 Friday (12/14/18)
- 3 Wednesday (12/12/18)
- 4 Monday (12/10/19)
- 5 Thursday (12/6/18)
- 6 Tuesday (12/4/18)
- 7 Friday (11/30/18)
- 8 Monday - Wednesday (11/26/18 - 11/28/18)
- 9 Monday (11/19/18)
- 10 Thursday (11/15/18)
- 11 Tuesday (11/13/18)
- 12 Wednesday (11/8/18)
- 13 Monday (11/5/18)
- 14 Thursday (11/1/18)
- 15 Archives
Tuesday - Thursday (12/18/18 - 12/20/18)
Agenda:
- Introduction to Recursion
- Recursion slides
- 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)
- Complete Activity 13
- Recursion Practice Examples - We will convert the following from iterative to recursive algorithms
- Monte Carlo Pi
- Taylor Series Pi and e
- Looping exercises
- ...and more 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)
Friday (12/14/18)
Warmup:
- Complete eIMACS: Activity 7 #3
Agenda:
- Test 9 review
- Overloaded methods
- When you have multiple methods of the same name, but different parameters (types or number of parameters)
- Examples:
- String's substring() method
- Processing's rect() method
- Complete Activity 12
Wednesday (12/12/18)
Agenda:
- Are you missing any work? (check eIMACS gradebook and StudentVUE)
- Complete Lab 1 on your own time
- For-each (enhanced for) loop
- Walk-through and examples
- Common pitfall(s)
- What are the advantages of a regular for loop? Disadvantages?
- What are the advantages of a for-each/enhanced? Disadvantages?
- When do you want to use a regular for loop vs. a for-each/enhanced for loop?
- Complete Test 9
Homework:
- Complete Lab 1: Chatter
- Complete Test 9
Monday (12/10/19)
Agenda:
- Complete Lab 1: Chatter
- Your project will be auto-graded when you export from NetBeans and upload it to eIMACS
Homework:
- Complete Lab 1: Chatter
Thursday (12/6/18)
Agenda:
- Go over eIMACS: Test 10 homework
- main method
- Comments
- Multiple variable declarations (comma-separated)
- Complete Lab 1: Chatter (you will need NetBeans or Eclipse)
Tuesday (12/4/18)
Warmup:
- Complete #1 of eIMACS: Activity 7: Checksums
Agenda:
- Make sure you have completed all repl.it methods assignments
- Complete eIMACS: Activity 11: Strings 2
- Use the AP CS exam quick reference card
- All methods should be able to be completed using the methods listed in the card
Homework:
- Complete eIMACS: Activity 7 #2
- Complete eIMACS: Test 10
Friday (11/30/18)
Agenda:
- Search & Sort Identification Quiz
- for loop demos - Practice 1 & 2
- Complete for Loop assignments in Repl.it
- Count Words
- double[] Average
- Reverse String Print
- Introduction to Methods
- Java Methods slides
- Java methods examples
- Complete repl.it methods assignments
Monday - Wednesday (11/26/18 - 11/28/18)
Warmup:
- Write a program that takes a String input, uses a for loop, and prints every other letter in the string
Agenda:
- for loop demos - Practice 1:
- Monte Carlo Pi
- Taylor Series Pi and e
- Looping exercises
- for loop demos - Practice 2:
- Linear search
- Binary search
- Selection sort
- Bubble sort
- 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)
Warmup:
- for loops quiz at the end of class
- Prepare to demo for looped version of:
- Monte Carlo Pi
- Taylor Series Pi and e
- Looping exercises
Agenda:
- Repl.it resubmits
- Binary search incorrect -- please redo and resubmit
- for Loop Practice 2 - Re-implement the following using for loops:
- Linear search
- Binary search
- Selection sort
- Bubble sort
- Insertion sort
- for loop assignments (repl.it submissions coming...)
- Write a program that takes a String input, uses a for loop, counts and displays the total number of spaces
- Write a program that takes a double[], uses a for loop, and displays the average value of all elements in the array
- Write a program that takes a String input, and displays the entire string reversed (on one line)
- Have a great Thanksgiving Break!
Thursday (11/15/18)
Warmup:
- Login to your albert.io account
- Join our AP CS A course using: EMVT7IN8APTL
Agenda:
- Java for loops (eIMACS: For Loops)
- Write a for loop that prints out 0 to 10 (exclusive)
- Write a for loop that prints out 100 to 50 (inclusive)
- Write a for loop that prints out the first 10 odd numbers
- for Loop Practice 1 - Convert the following programs from a while loop to a for loop (due Monday (11/19/18))
- Monte Carlo Pi
- Taylor Series Pi and e
- Looping exercises
Tuesday (11/13/18)
Agenda:
- Bubble sort questions?
- Bubble sort should be done by now
- NetBeans installation check
- JGrasp installation check
- JGrasp canvas visualization practice
- Simple variables
- Array
- Loop
- Insertion Sort Assignment
- Study the insertion sort visualization VisuAlgo
- What are the major components of the algorithm? (e.g. Loop that iterates through array from beginning to end) Others?
- 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)
Agenda:
- Selection sort assignment in repl.it should be already complete
- Watch the bubble sort visualization at VisuAlgo
- Watch it multiple times until you have a firm understanding of what is happening
- You can also read slide 5 about bubble sort in the Sorting slides
- 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
- Future assignments will implement insertion sort and merge sort algorithms. You are encouraged to watch the VisuAlgo visualizations to understand those algorithms
Monday (11/5/18)
Warmup:
- Assume you have a given int[] named arr
- 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:
- Complete the Find Minimum & Maximum repl.it
- Group sorting activity
- Form 3-4 person groups
- Receive playing cards
- With your group, document step-by-step an algorithm (steps) of how you sort the cards out
- Every group will share their algorithm in class
- Paste your sorting algorithm in this group document - Don't forget to put your names
- Introduction to Sorting
- Complete Selection sort assignment in repl.it
Thursday (11/1/18)
- While loops quiz
- 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)