AP computer Science A


Older Syllabus_2016_AP_CS_Baharav_Block_2.pdf



Java Methods, Third AP* Edition
Be sure to download from there: Student files ; Slides


Practice online:


Learn online:



Course outline:

  1. Intro and setup.
    1. Topics: Setup the environment: JDK, IDE, Editor, Github.
      This one does it all: Installation_NetBeans_JDK_Eclipse.pdf
      Just if you need: JDK: Oracle JavaSE IDE - NetBeans: https://netbeans.org/ Screen-shot
      Editors: Atom [https://atom.io/] or Sublime [https://www.sublimetext.com/]
      Netbeans and Git (Clone) ; https://github.com/
    2. Resources for the Java Methods book: Student files ; Slides
    3. In class activity: Syllabus. AP. Game of Nim (intro to algorithms). Installation.
  2. "Hello World"
    1. Topics: Command line, IDE, graphics, and GitHub classroom setup.
    2. Code: "Hello World" Command line [github] - Javac, java.
    3. Code: "Hello World"" IDE [github] - Working with the IDE.
    4. Code: "Hello World" Graphics [github] - Intro to graphics.
    5. Code: "Hello World" Github [github] - Working with IDE and github. Homework: First homework on Github Classroom.
    6. Code: KPoint [github] - Introduction to class, fields, methods, constructors. Homework: Add functionality to the point class.
  3. Primitive types + Strings
    1. Topics: Primitive types: Char, int, double, boolean.
    2. Topics: Strings: Objects, length, substring, charAt, indexOf, compareTo, equals.
    3. Drill: Codingbat- Warmup, String-1, no loops.
      1. HelloName
      2. FirstHalf
      3. MissingChar.
      4. HasBad.
      5. sleepIn
    4. Code: KString [github] - Our own String class. Homework: Hyphen2(), isPalindrome().
    5. Code: TempConverter [github] - Homework: Simple integer arithmetic.
    6. Code: BaseConverter [github] - Converting between Dec, Binary, Octal, and Hex. Homework: Complete the class.
  4. Bollean + if()
    1. Topics: Boolean, logical operators: Simple. De Morgan's law.
    2. Topics: if().
    3. Drill: Codingbat- logic-1. Warmup
      1. QQQQ
    4. Drill: PracticeIt-
      1. Logic, not programming. Nice one to start! ifElseMystery1
      2. Logic, little harder than 1. ifElseMystery2
      3. Nice Programming quadrant
      4. If/then/else: Do this one together in class, to see good programming style. Coordinates
      5. A little harder ones:
      6. if/else with integer division. No program, just MC. ifElseSimulation
      7. if/else Days in month: daysOfMonth
      8. if/else Tax: Tax
  5. While() and for() loops
    1. Hangman [github] - Loops and strings. Homework: Complete the game.
    2. for()
    3. Codingbat- String-2, including loops.
      1. doubleChar
      2. Bob there.
      3. ZipZap. (not easy!)
      4. xyBalance.Seems complicated, but has a VERY neat solution.
    4. Nested for() loops
    5. Triangles and pyramids [github] - Nested loops for printing ASCII art. Homework: Complete shapes.
    6. Langauge feature: break and continue.
    7. Prime: isPrime(), allPrimesUpTo(), firstNPrimes() [ github]
    8. Codingbat- String-3, nested loops. Well, you might use. Don't have to.
      Paying attention to 'first time right' (or minimum times wrong).
      Then, paying attention to reduced code!
      1. countTriple Simple one to start with.
      2. gHappy - Logic makes it simple.
      3. sameEnds
      4. maxBlock - Not really complicated. Think simple.
      5. withoutString - Two hints:
        1. Use str.toLowerCase() when comparing.
        2. Substitute from the ORIGINAL string (not from lowercase). Like the Hangman.
    9. Codingbat- String-3, nested loops. Two problems I wrote to demeonstrate use of While() and use of tmp.
      1. switchXwithNext - use of tmp.
      2. stringCombine - multiple indexes.
      3. Write your own CodingBat problems! Here is what the students came up with (very original!!):
  6. 1D Array
    1. Basic 1D array cnocepts and operations : [github]
      1. 1D Array: CodingBat - Array-1 (no loops)
        1. firstLast6
        2. no23
        3. sum3
        4. makeLast
        5. plusTwo
        6. frontPiece
      2. 1D Array: CodingBat - Array-2 (loops)
        1. countEvens
        2. shiftLeft. Interesting.
        3. sum67
        4. centeredAverage. We'll do this one together as well.
      3. 1D Array: CodingBat - Array-2 (loops) and Array-3 (Nested or multiple loops)
        1. twoTwo - Keep it simple: We have seen the pattern.
        2. zeroFront - Special interest: Continue/break.
        3. evenOdd - Indices. one loop.
        4. Array-3
        5. canBalance - Simple loops. Logic.
        6. squareUp - Indices. Nested loop. simple logic.
      4. PracticeIt warmups:
        1. arrayMystey-final1
        2. arrayMystey-final2
    2. Random: java.util.Random and Math.random.
      Command line arguments.
      Homework: 1D array shuffle [ github].
    3. (We did not do this year) Homework: Fibonnaci class (return array, return element, return next element) [ github].
  7. 2D Array
    1. Magic square [github].
    2. Homework: Haiku (2D array decoding) [github].
    3. Project: Battleship. 2D array, AI: [github].
  8. Some more workouts on Arrays - CodingBat.
    1. Blitz:
      1. commonEnd
      2. maxEnd3
      3. double23
    2. HW:
      1. zz : Array of Strings
      2. countClumps (medium/hard)
      3. fix34 (challenging)
      4. Mirror (hard)
  9. Battle Ship: AI Project [ github].
  10. ArrayList
  11. Practicing
    1. FR String question from 2017: Nth occurence



^ Password protected.


Questions/Comments: Zbaharav at Kehillah dot Org or Zachi at Baharav dot Org .