Tuesday, January 31, 2017

February 1, 2017

Objective:  Wrap up DrawingBoard project

Activities
  • Group discussion - instance variables and methods needed by ShapeGroup
    • Volunteer to show his or her implementation of ShapeGroup, lead discussion
  • Finish implementation of ShapeGroup, Triangle
  • Make a ShapeGroup of a recognizable shape
  • Continue filling out Test 2 study guide

Homework:  Test 2 Study Guide, due Thursday.  Copy from couplands.net > AP CSA > Resources 

January 31, 2017

Objective: Use generics and polymorphism to implement a ShapeGroup object

Activities
  • Discussion:  encapsulation, inheritance, and polymorphism (principles of object-oriented programming)
  • ArrayList<E> - E is the class for the elements in the ArrayList. 
    • ShapeGroup will contain an ArrayList of Shapes 
    • private ArrayList<Shape> shapes;
  • Implement ArrayList class
Homework:  Test 2 Study Guide, due Thursday.  Copy from couplands.net > AP CSA > Resources

January 30, 2017

Objective: Implement a class hierarchy of shapes

Activities
  • Discussion: inheritance and polymorphism
  • Implement static final variables in Shape for colors
  • Implement RightTriangle class
Homework:  Test 2 Study Guide, due Thursday.  Copy from couplands.net > AP CSA > Resources

Friday, January 27, 2017

January 27, 2017

Objective:  Apply variable modifiers: pubic, protected, private, static, final

Activities
  • Inheritance and access to static variables
  • DrawingBoard project
    • Add variables to count all Shapes made and all Rectangles made 
    • Add methods to get these values
    • Continue with implementation of Triangle

Thursday, January 26, 2017

January 26, 2017

Objective: Simplify code using inheritance


 More at https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html

Activities
  • Review and discuss access levels in Java: fields and methods, class and instance.  Good example at link. 
  • Discuss static and final
  • Add static final variables to Shape for common colors.  Shape.RED, etc.
  • Add static method to Shape for computing points on a line.  xForY
  • Finish Shape & Rectangle
  • Implement RightTriangle class

Wednesday, January 25, 2017

January 25, 2017

Objective: Avoid duplicating code by using inheritance

Activities
  • Discussion of subclassing and inheritance.  What is inherited?
  • Public, protected, and private methods and variables
  • Implement the Shape and Rectangle classes


Tuesday, January 24, 2017

January 24, 2017

Objective:  Simply program design using inheritance

Activities
  • Implement and test Shape and Rectangle objects for DrawingBoard project

January 23, 2017

Objective:  Design a class hierarchy for the DrawingBoard project

Activities
  • Discussion of inheritance and class hierarchies
  • Start implementing Shape and Rectangle objects

Thursday, January 19, 2017

January 19, 2017



Homework:  Read Barron's Chapter 2 pp. 92-99.  Do MC questions 1-5 pn pp. 111-113

Wednesday, January 18, 2017

January 18, 2017

Objective:  Test 1

Activities
  • Test 1 - Operators, Control Structures, and 1-D arrays
  • Brainstorm class hierarchy for DrawingBoard project

Thursday, January 12, 2017

January 13, 2017

Objective: Practice decoding and writing answers to AP CSA free response questions

Activities
  • Homework check: Barron's chapter 1 MC 1-7, 10-15, 23-24
  • Free Response practice: 2011 FR 1 pp. 2-4
  • Finish  challenges 1-1 to 1-4
Homework: 
  • Finish Challenge 1-4 Histogram.  
  • Study for Test 1, which covers Chapter 1 and Chapter 6 pp. 233-240 (one dimensional arrays)

Wednesday, January 11, 2017

January 12, 2017

Objective: Write Java programs with 1-dimensional arrays
  • Challenge 3: An ArrayUtilities class
    • public static double min(double[] nlist)
    • public static double max(double[] nlist)
    • public static double average(double[] nlist)
    • public static void sort(int[] nlist) 
  • Challenge 4: Add a printHistogram method to your ArrayUtilities class
    • public static void printHistogram(double[] data, double[] bins)
    • Prints a horizontal histogram of the values in data. Line i has n asterisks, where n is the number of data values within [ bin[i] and bin[i+1] ) 
    • Sample data set:
 85, 80, 90, 95, 90, 95, 92.5, 55, 97.5, 70, 75, 45, 80, 90,
55, 85, 55, 60, 90, 62.5, 85, 90, 100, 95, 100, 95, 97.5, 50, 75, 90,
100, 65, 65, 100, 85, 60, 90, 97.5, 50, 40, 90, 95, 62.5, 100, 82.5, 100, 85,
97.5, 95, 100, 97.5, 97.5, 65, 95, 92.5, 80, 80, 85, 77.5, 90

  • Homework
    • Read Barron's pp. 57-63
    • Do MC problems 1-7, pp. 77-78
    • Tomorrow: homework check for Barron's chapter 1 MC 1-7, 10-15, 23-24

January 11, 2017

Objective:  Solve problems with Java arrays

Activities
  • Declaring and accessing arrays in Java
  • Challenge 3: An ArrayUtilities class
    • public static double min(double[] nlist)
    • public static double max(double[] nlist)
    • public static double average(double[] nlist)
    • public static void sort(int[] nlist) 

Monday, January 9, 2017

January 10, 2017

Objective:  Write and decode nested control statements.  Write and decode Boolean expressions.

Activities
  • Check homework: Chapter 1 MC questions 10, 15, 23, 24
  • Boolean expressions.
    •  boolean snowDay, weekDay;
    • double snowAccumulation, windChill;
    • snowDay = ???
  • DeMorgan's Law
    •  !(a & b) is equivalent to !a || !b
    •  truth tables
  •  Arithmetic expressions
  • Challenge 2: Print triangles
    • Isosceles right triangle of size n
    • Isosceles right triangle of size n in any of four orientations
Homework:
  • Read Barron's pp. 63-67: Operators
  • Do Ch 1 MC 5, 11, 12, 13, 14
  • Finish the Prime Years and Print Triangles challenges

Friday, January 6, 2017

January 9, 2016

Objective: Review if, for, and while statements

Activities
  • Challenge 1: How many years in the 21st century are prime numbers?  Write a Java application to find out.
  • Javadoc comments - required for future submissions.  
    • p. 59 in Barron's.  @param, @return, @throws
    • Add Javadoc comments to your prime years application
    • Use Project > Generate Javadoc to create the documentation for your project
    • Find the doc files in the Eclipse package explorer.  Take a look!
  •  Challenge 2: Print triangles
    • Isosceles right triangle of size n
    • Isosceles right triangle of size n in any of four orientations
Homework:
  • Read Barron's pp. 69-74: Control Structures
  • Do Chapter 1 MC questions 10, 15, 23, 24.  Write explanations in your problem notebook - the answer is 'a' because... 
  • Friday: Homework check for Barron's chapter 1 MC 1-7, 10-15, 23-24