IB Computer Science 2

From WLCS
Revision as of 11:02, 18 October 2018 by Admin (talk | contribs)

Thursday (10/18/18)

Agenda:

  • Go to your App Catalog and look for NetBeans -- is it there?
  • Demo Mosaic and Pointilism assignment(s) today
  • Java Objects Slides
  • Point Class assignment - complete in NetBeans or repl.it (*must* submit to repl.it for auto-testing)
    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 (skip this for now)
    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
  • More Java class assignments - complete in NetBeans or repl.it (*must* submit to repl.it for auto-testing)

Tuesday (10/16/18)

Agenda:

  • Creating a blank image and manipulating the pixels
    1. Rotate 90 degrees clockwise
  • Complete and demo the following image processing assignments:
    1. Rotate 90 degrees clockwise of a non-square image (no animation needed)
    2. Mosaic (no animation needed)
      1. Take an image, sample every (10th row, 10th col) pixel's color
      2. Draw a 10x10 square using the sampled pixel's color at ever 10th (x,y)
      3. You should display both the original image and its mosaic
    3. Pointilism Animation
      1. This will be an animation
      2. Within setup(), load an image, load its pixels, and turn off line strokes
      3. Within draw(), generate a random index number from 0 to image's pixel length (use random())
        • int rand = (int) random(0, img.pixels.length);
      4. Sample the color of the pixel from the random index and fill with the color
      5. Calculate the appropriate (x,y) from the random index (Hint: use modulus (%) for x and division (/) for y)
      6. Draw the circle at its appropriate (x,y) using a random diameter from (5, 15)

Homework:

  • All of the image processing assignments are due Thursday (10/18/18)

Tuesday - Friday (10/9/18 - 10/12/18)

Agenda:

  • Demo Media:BubbleSort.java
  • Algorithms Identification Quiz in Canvas
  • Reference variables 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 a method: void matrixPrint(int[][] m)
      • Print each row on a separate line, and each element should be separated by a space
      • Complete the method in repl.it
  • Nested Loops, Processing & Images
    • Processing coordinate system review (print mouse coordinates)
    • Processing PImage object practice
    • Processing: Images & Pixels Tutorial
    • As a class, we'll walk through several of the examples from the tutorial above, and we'll modify each slightly
  • Image Processing Exercises?
    1. Convert to black and white
    2. Rotate image 90 degrees
    3. Flip vertical
    4. Flip horizontal
    5. Pointilism
    6. Mosaic
    7. Edge detection?

Homework Challenge:

  • Try to complete the rotate 90 degrees image challenge

Thursday (10/4/18)

Agenda:

  • Make sure you've completed Selection Sort in repl.it
    • Mr. Bui will be manually looking at your repl.it submissions too
  • Take the Sorting Identification Quiz in Canvas
    • The access code is ...
  • Bubble sort review
  • Complete and demo Media:BubbleSort.java

Tuesday (10/2/18)

Warmup:

  • Take the Abstract Data Structures Pre-assessment on Canvas
    • Do not guess answers, skip them if you do not know the answer
  • Complete the Find Minimum & Maximum repl.it

Agenda:

  • Group sorting activity
    1. Form 3-4 person groups
    2. Receive playing cards
    3. With your group, document an algorithm (steps) of how you sort the cards out
  • Introduction to Sorting
  • Selection sort assignment in repl.it

Archives