Difference between revisions of "IB Computer Science 2"

From WLCS
Line 1: Line 1:
 +
== Monday (9/26/11) ==
 +
'''Agenda:'''
 +
* SelectionSort Review
 +
* Demo SelectionSort.java
 +
* Demo the sort option added to your AddressBook
 +
* Introduction to Bubble Sort
 +
# Initialize the front to be the top or beginning of the array
 +
# Now go to the bottom/end of the array
 +
# Compare the two adjacent elements to see if they are in proper sequential order
 +
## Swap the elements if they are out of order (bigger number to the left of smaller number)
 +
# Move to the next pair of adjacent elements/numbers
 +
# Repeat steps 3 and 4 until the smallest number has "floated" to the top/front
 +
# After you traverse the entire array
 +
## Move the front so that the sorted numbers are ignored
 +
## Go back to the end of the array
 +
## Repeat steps 2 through 6 for the unsorted part of the array
 +
<!--* [http://web.engr.oregonstate.edu/~minoura/cs162/javaProgs/sort/BubbleSort.html Bubble Sort Animation]-->
 +
* [http://math.hws.edu/TMCM/java/xSortLab/ Sorting Animations]
 +
* [http://www.cs.pitt.edu/~kirk/cs1501/animations/Sort2.html More Sorting Animations]
 +
* Download [[Media:BubbleSort.java]]
 +
** Fill in the commented parts of the BubbleSort.java file. Where there is a comment, you need to write code.
 +
** Demo to Mr. Bui at the end of class
 +
* Introduction to the Program Dossier
 +
** [[Media:CriterionA1_problemAnalysis.doc]]
 +
** Analyzing the Problem due Tuesday (10/4/11)
 +
** Work on your Analyzing the Problem section
 +
 +
'''Homework:'''
 +
* Any leftover AddressBook demonstrations (including a sort option)
 +
* SelectionSort and BubbleSort
 +
* Analyzing the Problem due Tuesday (10/4/11)
 +
 
== Thursday (9/22/11) ==
 
== Thursday (9/22/11) ==
 
'''Warmup:'''
 
'''Warmup:'''

Revision as of 12:24, 26 September 2011

Monday (9/26/11)

Agenda:

  • SelectionSort Review
  • Demo SelectionSort.java
  • Demo the sort option added to your AddressBook
  • Introduction to Bubble Sort
  1. Initialize the front to be the top or beginning of the array
  2. Now go to the bottom/end of the array
  3. Compare the two adjacent elements to see if they are in proper sequential order
    1. Swap the elements if they are out of order (bigger number to the left of smaller number)
  4. Move to the next pair of adjacent elements/numbers
  5. Repeat steps 3 and 4 until the smallest number has "floated" to the top/front
  6. After you traverse the entire array
    1. Move the front so that the sorted numbers are ignored
    2. Go back to the end of the array
    3. Repeat steps 2 through 6 for the unsorted part of the array

Homework:

  • Any leftover AddressBook demonstrations (including a sort option)
  • SelectionSort and BubbleSort
  • Analyzing the Problem due Tuesday (10/4/11)

Thursday (9/22/11)

Warmup:

  1. Form a group of 3 people
  2. Receive several playing cards from Mr. Bui
  3. Shuffle the cards
  4. Sort them in numerical order by repeatedly finding the smallest card and separating it

Agenda:

  • Introduction to Selection Sort
  1. Find the smallest element
  2. Move to the front of the array (swap with front)
  3. Repeat Steps 1&2, but ignoring the sorted front
if (str1.compareTo(str2) < 0)
{
  System.out.println(str1 + " goes before " + str2);
}
  • So inside your AddressBook, you'd have something like this:
if (myContacts[i].getLastName().compareTo(myContacts[j].getLastName()) < 0)

Friday - Tuesday (9/16/11 - 9/20/11)

Warmup:

Agenda:

  • Return Software Development Quizzes
    • Corrections for 1/2 partial credit (Turn in corrections by the end of the week)
  • Complete AddressBook class lab assignment by the end of class

Wednesday (9/14/11)

Warmup:

Agenda:

  • Java Review?
    • How does it all work?
    1. Create Java Classes (object blueprints)
    2. Create a separate main class with a main method. The main method can use other objects defined in classes.
  • Review Arrays
  • Array practice activities
    1. Create a new Java class named ArrayPractice1. Create an array of 10 Strings (Use names of students in the room). Using a for loop, print out all the Strings in the array.
    2. Create a new Java class named ArrayPractice2. Create an array of 10 integers (make a bunch of numbers up). Using a for loop and an if statement, print print out only numbers greater than 10.
    3. Create a new Java class named ArrayPractice3. Create an array of 10 integers. Using a for loop, calculate the sum and average.
  • AddressBook beginning walk-through
  • AddressBook class lab assignment

Homework:

  • Install the Java JDK on your computer (be sure to choose your corresponding operator system)
  • Install Eclipse Classic on your computer (be sure to choose your corresponding operator system on the right)
  • Test it out, and let Mr. Bui know if you run into problems

Monday - Wednesday (9/12/11 - 9/14/11)

Warmup:

  • Redo the Comfort Zone Survey
  • Be prepared to demo Contact
  • Cram for quiz (Hint: There is a question on almost every slide...lol!)

Agenda:

Homework:

  • Install the Java JDK on your computer (be sure to choose your corresponding operator system)
  • Install Eclipse Classic on your computer (be sure to choose your corresponding operator system on the right)
  • Test it out, and let Mr. Bui know if you run into problems


Tuesday - Thursday (9/6/11 - 9/8/11)

Warmup:

Agenda:

Homework:

Summer