AP CS A Unit 2

Unit 3, Day 1

Mr. Jones | AP Computer Science A

Warmup

Discuss with your table - in what ways is the function machine a good representation of methods in Java?

Function Machines

Function Robot

Borrowed from here: https://www.deviantart.com/nihima/art/Calculation-Robot-404224285

3 Parts of a method

  • Parameters
  • Return Value
  • Behavior (side effects)

Types of methods

  • “Pure functions”
    • Have no side effects
  • “Void” methods
    • Have only side effects, no returns

Practice with void methods

  • CodeHS 3.2.8

Upcoming Schedule

Upcoming Schedule

  • Today - Start Unit 3
  • Thursday - Q1 Exam (aka retakes)
  • Monday (11/6) - More Unit 3
  • Tuesday (11/7) - No school! Teacher workday
  • Friday(11/10) - No school! Veteran’s Day

Unit 3:

  • A few odds and ends:
    • One more boolean operator
    • Working with Strings
    • ConsoleProgram
  • Methods

Strings and ConsoleProgram

Work on CodeHS Problem: 2.15.4 Three Strings

Recap Unit 3, Day 1

This is a recap slide

(To be completed)

More recap

(Coming soon)