IB Computer Science 2

From WLCS
Revision as of 15:46, 5 October 2016 by Admin (talk | contribs)

Thursday (10/6/16)

Agenda:

  • Demo your matrix functions using the matrices on the board
  • Java Objects
  • Point Class assignment walk-through
    1. You will create two java files: Point.java and PointMain.java
      • Point.java - the Point class definition will be here
      • PointMain.java - only the main() method will be located here
    2. Declare and initialize the following private attributes in the Point class
      • double x = 0.0
      • double y = 0.0
    3. Define two Point() constructors:
      • default constructor: Point()
      • specific constructor Point(double newX, double newY)
    4. Define the following public methods in the Point class
      • double getX() - returns the x-coordinate
      • double getY() - returns the y-coordinate
      • void setX(double newX) - sets the x-coordinate to the new x-coordinate parameter
      • void setY(double newY) - sets the y-coordinate to the new y-coordinate parameter
      • String toString() - returns a String representation of the Point object
    5. Go to your PointMain.java file to test out your Point class
    6. In the main method, create several new instances of Point objects
    7. Print out each of your Point objects
    8. Define a static method in PointMain.java named double slope(Point p1, Point p2) - returns the slope between p1 and p2
    9. Test and print out your slope method when you use it with your instantiated Point objects in the main() method

Tuesday (10/4/16)

Agenda:

  • Two-Dimensional Array Assignment
    1. Write a method (function): matrixAdd(m1, m2) that returns a new matrix that is the sum of m1 and m2
      • Be sure to check if the two matrices are the same size (if not, then return null)
    2. Write a method (function): matrixMult(m1, m2) that returns the product of matrix m1 and m2
      • Be sure to check the rules of matrix multiplication
      • Return a null matrix if their sizes do not allow for proper multiplication

Friday (9/30/16)

Agenda:

  • Demo missing sorting algorithms (SelectionSort, BubbleSort)
  • Quicksort Overview
  • Two-Dimensional Arrays and Nested Loops
    1. Accessing all of the individual elements of a two-dimensional list
    2. Prompt the user to construct a two-dimensional list
      1. Prompt for the number of rows
      2. Prompt for the number of columns
      3. Prompt the user for each number in the two-dimensional list
    3. Write the function matrixPrint(m)

Monday - Wednesday (9/26/16 - 9/28/16)

Warmup:

  1. Do the following warmup if you have completed the JavaSearchAssignment.java
  2. Create a 2-3 person group
  3. Take some (~6) playing cards
  4. Lay them out randomly in a row (out of order)
  5. As a team, discuss an algorithm to sort them
  6. You are only allowed to swap cards (i.e. they cannot be removed or added to a new array)
  7. Sort them in numerical order (Ace is high)
  8. Write down the basic steps to your algorithm

Agenda:

Thursday (9/22/16)

Warmup:

Agenda:

Back to School Night

Tuesday (9/20/16)

Agenda:

Homework:

Friday (9/16/16)

Agenda:

Homework:

  1. Complete the syllabus agreement form with your parent
  2. Complete the CodingBat: Array-1 & Array-2 exercises listed above (from class)

Wednesday (9/14/16)

Agenda:

Homework:

  1. Complete the syllabus agreement form with your parent
  2. Complete the CodingBat: String-1 & String-2 exercises listed above (from class)

Monday (9/12/16)

Agenda:

Homework:

  1. Go to Syllabus (on the left)
  2. Read it
  3. Complete the agreement form with your parent (you will need your APS Google login)

Thursday (9/8/16)

Homework:

Tuesday (9/6/16)

Homework:

  1. Go to Syllabus (on the left)
  2. Read it
  3. Complete the agreement form with your parent (you will need your APS Google login)

Summer

Archives