Please enable JavaScript to use CodeHS


AP Computer Science A (Nitro)

Lessons

  1. Primitive Types

    1. 1.1 Why Programming? Why Java?

    2. Description

      In this lesson, students will be introduced to and practice using the Java main skeleton that includes the class and main method arguments. They will use the System.out.print and System.out.println commands to print string literals in the editor. This lesson corresponds with AP Computer Science A topic 1.1.

    3. Objective

      Students will be able to:

      • call system class methods to generate output to the console
      • recognize the difference between display behavior of System.out.print and System.out.println
      • create string literals
    4. 1.2 Variables and Data Types

    5. Description

      In this lesson, students will learn about variables. Variables allow information to be stored such as numbers, words, or true/false expressions. A variable can be thought of as a box that stores information inside. In Java, variables are composed of three things: a name, type, and value. This lesson corresponds with AP Computer Science A topic 1.2.

    6. Objective

      Students will be able to:

      • declare, initialize and assign a value to a variable
      • identify the most appropriate data type category for a particular specification
      • categorize a data type as either primitive or reference
      • declare a final variable
    7. 1.3 Expressions and Assignment Statements

    8. Description

      In this lesson, students learn how to use arithmetic expressions in Java. Arithmetic expressions allow the use of mathematical operations within Java. Students will also learn about the modulus operator (%) and how it is evaluated. Such expressions can be used for basic math and even more complex algorithms. This lesson corresponds with AP Computer Science A topic 1.3.

    9. Objective

      Students will be able to:

      • evaluate arithmetic expressions in a program code
      • use the modulus operator (%)
    10. 1.4 Compound Assignment Operators

    11. Description

      In this lesson, students will learn how to use the increment operator (++), the decrement operator (--) and compound assignment operators (+=, ?=, *=, /=, %=). The increment operator (++) and decrement operator (??) are used to add 1 or subtract 1 from the stored value of a variable. The new value is assigned to the variable. This lesson corresponds with AP Computer Science A topic 1.4.

    12. Objective

      Students will be able to:

      • Evaluate what is stored in a variable as a result of an expression with an assignment statement
      • Use a compound assignment operators (+=, ?=, *=, /=, %=) in place of the assignment operator
      • Use an increment operator (++) or decrement operator (??) to add 1 or subtract 1 from the stored value of a variable
    13. 1.5 User Input

    14. Description

      In this lesson, students will learn how to receive user input with the Scanner class in Java. After creating a new Scanner object, they will learn the commands below that will allow them to take in data from the user.

      String name = input.nextLine();
      int number = input.nextInt();
      double decimal = input.nextDouble();
    15. Objective

      Students will be able to:

      • import and initialize a new Scanner to take in user input
      • create variables that take the assigned value of the user input.
      • choose the correct command that will allow the program to receive the input value that corresponds with its desired data type

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU (Var-1) To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. (LOs 1.A, 1.B)
    16. 1.6 Casting and Ranges of Variables

    17. Description

      In this lesson, students will learn how to change the data type of a value through the process of casting. They will also use casting to help round double values to the closest integer value. Students will explore the range of variables allowed in Java and understand integer overflow when a value outside of this range is attempted. This lesson corresponds with AP Computer Science A topic 1.5.

    18. Objective

      Students will be able to:

      • Evaluate arithmetic expressions that use casting
      • Understand that integer values in Java are stored using a finite amount (4 bytes) of memory. Therefore, an int value must be in the range from Integer.MIN_VALUE to Integer.MAX_ VALUE inclusive
      • Understand when an expression evaluates to an int value outside of the allowed range, an integer overflow occurs
      • Recognize and use implicit casting
      • Use casting to round to the nearest integer
    19. 1.7 Primitive Types Quiz

    20. Description
    21. Objective
  2. Using Objects

    1. 2.1 Objects: Instances of Classes

    2. Description

      In this lesson, students are introduced to classes and objects. These are the foundations of object oriented programming.
      Students will learn about objects that have state and behavior, and classes which are the templates for creating objects. This lesson corresponds with AP Computer Science A topic 2.1.

    3. Objective

      Students will be able to:

      • Explain the relationship between a class and an object
      • Create classes with instance variables
    4. 2.2 Creating and Storing Objects (Instantiation)

    5. Description

      In this lesson, students will create and use constructors. The constructor, or signature of a class, allows for the creation of a new object. Students will create objects by calling constructors with parameters. Parameters are values that are passed into a constructor. These are referred to as actual parameters. This lesson corresponds with AP Computer Science A topic 2.2.

    6. Objective

      Students will be able to:

      • Create and use constructors
      • Create objects by calling constructors with parameters
    7. 2.3 Overloading

    8. Description

      In this lesson, students are introduced to method overloading. This is when several different methods are written, each with the same name. As long as each method’s parameter list is different, the same method name can be used multiple times! This lesson corresponds with AP Computer Science A topic 2.2.

    9. Objective

      Students will be able to:

      • Explain the purpose of method overloading
      • Create classes that overload methods
      • Explain how null objects do not point to any particular object data
      • Create programs that use other classes as a client to solve a specific problem
    10. 2.4 Calling a Void Method

    11. Description

      In this lesson, students will take a deeper look into creating and calling the methods of a class. Methods are procedures that define and allow for control of the behavior of an object. Once an object is instantiated, the instance variables can be used across the different methods that are created. Students will also learn about procedural abstraction for methods that can be used without knowing all of the underlying details and code. This lesson corresponds with AP Computer Science A topic 2.3.

    12. Objective

      Students will be able to:

      • Create and call class methods
      • Call non-static void methods without parameters
    13. 2.5 Calling a Void Method with Parameters

    14. Description

      In this lesson, students will build on what they have learned and discover how to call a void method with parameters. Just as constructors can have parameter values, methods can have formal parameters that affect the state of the object as well. Methods can also be overloaded just like constructors! This lesson corresponds with AP Computer Science A topic 2.4.

    15. Objective

      Students will be able to:

      • Call non-static void methods with parameters
    16. 2.6 Calling a Non-void Method

    17. Description

      In this lesson, students will learn how to call a non-void method and return a value from a method by using the keyword return. The return keyword returns a variable or value back to the existing program so it can be used further along in the program. This lesson corresponds with AP Computer Science A topic 2.5.

    18. Objective

      Students will be able to:

      • Create and call non-void methods with parameters and return values
    19. 2.7 String Objects

    20. Description

      In this lesson, students will learn about the immutability of Strings as objects. Once a String object is created, it cannot be changed or manipulated. The only way to change a String value is to reassign the variable with a different String value. Students will also practice String concatenation using operators such as + and += and use escape sequences such as \? and \n. This lesson corresponds with AP Computer Science A topic 2.6.

    21. Objective

      Students will be able to:

      • Create String objects for a String class
      • Concatenate Strings using operators and escape sequences
    22. 2.8 String Methods

    23. Description

      In this lesson, students will look at Strings as a sequence of characters and utilize String methods from the java.lang package. Students will learn about packages, libraries and documentation. The following String methods will be examined in this lesson:

      name.length() 
      name.substring(2, 6)
      name.indexOf(?d?)
      name.equals(?Karel?)
      name.compareTo(?Karel?)

      This lesson corresponds with AP Computer Science A topic 2.7.

    24. Objective

      Students will be able to:

      • Call String methods for a String class
      • Explain the importance of APIs, documentation and packages in Java

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Var-1 To find specific solutions to generalizable problems, programmers include variables in their code so that the same algorithm runs using different input values. (LO’s 1.E, 1.D)
      • EU Mod-1 Some objects or concepts are so frequently represented that programmers can draw upon existing code that has already been tested, enabling them to write solutions more quickly and with a greater degree of confidence. (LO’s 1.G, 1.F, 1.C)
    25. 2.9 Wrapper Classes: Integers and Doubles

    26. Description

      In this lesson, students will learn how to convert primitive types to object types using a wrapper class. They will learn how Java automatically converts types using autoboxing and unboxing. This lesson corresponds with AP Computer Science A topic 2.8.

    27. Objective

      Students will be able to:

      • Create Integer and Double objects for wrapper classes
      • Call Integer and Double methods for wrapper classes
    28. 2.10 Using the Math Class

    29. Description

      In this lesson, students will learn about static methods. Static methods are methods that can be called without creating an object. More specifically, students will discover and practice using static methods in the Java Math class. The following Math class methods will be examined in this lesson:

      Math.abs(x)
      Math.pow(base, exponent)
      Math.sqrt(x)
      Math.random()
      Math.round()
      Math.cos()
      Math.sin()
      Math.PI
      

      This lesson corresponds with AP Computer Science A topic 2.9.

    30. Objective

      Students will be able to:

      • Call static methods
      • Evaluate expressions that use the Math class methods
    31. 2.11 Using Objects Quiz

    32. Description
    33. Objective
  3. Boolean Expressions and if Statements

    1. 3.1 Boolean Expressions and if Statements

    2. Description

      In this lesson, students will learn about Boolean expressions and relational operators. Relational Operators are constructs in programming that allow for the comparison of the values of two expressions. This lesson corresponds with AP Computer Science A topic 3.1.

    3. Objective

      Students will be able to:

      • Evaluate Boolean expressions that use relational operators in program code
    4. 3.2 if Statements and Control Flow

    5. Description

      In this lesson, students will learn about control structures and if statements. If statements are used in programming when there are a set of statements that should be executed only when certain conditions are met. This lesson corresponds with AP Computer Science A topic 3.2.

    6. Objective

      Students will be able to:

      • Represent branching logical processes by using flowcharts
      • Use if statements
    7. 3.3 if-else Statements

    8. Description

      In this lesson, students will expand their knowledge of control structures and learn about if/else statements. This lesson corresponds with AP Computer Science A topic 3.3.

    9. Objective

      Students will be able to:

      • Use if/else statements
    10. 3.4 else if Statements

    11. Description

      In this lesson, students will take control structures a step further and learn how to implement a statement with an else if condition. This lesson corresponds with AP Computer Science A topic 3.4.

    12. Objective

      Students will be able to:

      • Use an else if statement

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Con-1 The way variables and operators are sequenced and combined in an expression determines the computed result. (LO’s 1.E)
      • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.A)
    13. 3.5 Compound Boolean Expressions

    14. Description

      In this lesson, students will determine the truth value of compound Boolean expressions. They will also examine short circuit evaluation and nested if statements. This lesson corresponds with AP Computer Science A topic 3.5.

    15. Objective

      Students will be able to:

      • Evaluate compound Boolean expressions in program code
    16. 3.6 Equivalent Boolean Expressions

    17. Description

      In this lesson, students will examine De Morgan?s laws and determine when compound Boolean expressions are equivalent. They will use truth tables to display equivalent Boolean expressions. This lesson corresponds with AP Computer Science A topic 3.6.

    18. Objective

      Students will be able to:

      • Compare and contrast equivalent Boolean expressions
      • Apply De Morgan?s Laws to Boolean expressions
    19. 3.7 Comparing Objects

    20. Description

      In this lesson, students will learn the different ways of comparing objects and how it is different than comparing primitive types. With objects, because the variable is pointing to a location, the use of == is not possible, as the memory address is being compared between objects, not the actual values. Students will discover and use the .equals method. This lesson corresponds with AP Computer Science A topic 3.7.

    21. Objective

      Students will be able to:

      • Compare object references using Boolean expressions in program code
    22. 3.8 Boolean Expressions and if Statements Quiz

    23. Description
    24. Objective
  4. Iteration

    1. 4.1 Iteration

    2. Description

      In this lesson, students will learn how and when to use a while loop. Repetitive code can be avoided by using a while loop. While loops are used to repeat a set of statements until a condition is met. This lesson corresponds with AP Computer Science A topic 4.1.

    3. Objective

      Students will be able to:

      • Represent iterative processes using a while loop
      • Execute a return or break statement inside an iteration statement to halt the loop and exit the method or constructor
      • Develop an algorithm
      • Identify if an integer is or is not evenly divisible by another integer
      • Determine a minimum or maximum value
      • Compute a sum, average, or mode
    4. 4.2 For Loops

    5. Description

      In this lesson. students learn how to use for loops in their programs. The for loop allows students to repeat a specific part of code a fixed number of times.

      For loops are written like this:

      for(int i = 0; i < 4; i++)
      {
          // Code to be repeated 4 times
      }

      This lesson corresponds with AP Computer Science A topic 4.2.

    6. Objective

      Students will be able to:

      • Represent iterative processes using a for loop
    7. 4.3 Developing Algorithms Using Strings

    8. Description

      In this lesson, students will learn how to develop algorithms using Strings. Students will traverse Strings using a for loop and the print.length() command.

      for(int i = 0; i < string.length(); i++)
      {
          String character = string.substring(i, i+1);
      }
      

      This lesson corresponds with AP Computer Science A topic 4.3.

    9. Objective

      Students will be able to:

      • Develop an algorithm using Strings
      • Find if one or more substrings has a particular property
      • Determine the number of substrings that meet specific criteria
      • Create a new string with the characters reversed
    10. 4.4 Nested Iteration

    11. Description

      In this lesson, students will learn about nested loops. Nested loops are when loops are placed inside other loops to create more complex programs. When a loop is nested inside another loop, the inner loop must complete all its iterations before the outer loop can continue. This lesson corresponds with AP Computer Science A topic 4.4.

    12. Objective

      Students will be able to:

      • Represent nested iterative processes

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.C, 2.D, 2.E, 2.F, 2.G)
    13. 4.5 Informal Code Analysis

    14. Description

      In this lesson, students will examine the concept of informal code analysis. This includes an algorithm?s correctness, efficiency and the ability to be understood. This lesson corresponds with AP Computer Science A topic 4.5.

    15. Objective

      Students will be able to:

      • Compute statement execution counts of iterative statements
      • Compute informal run-time comparison of iterative statements
    16. 4.6 Iteration Quiz

    17. Description
    18. Objective
  5. Writing Classes

    1. 5.1 Writing Classes

    2. Description

      In this lesson, students will explore and learn the anatomy of classes. They will take a deeper dive into what the access specifier does, and how it can be used within programs to make data public or private. Students will learn about encapsulation and the responsibility programmers have to choose whether data should be accessible, modifiable, both or neither. This lesson corresponds with AP Computer Science A topic 5.1.

    3. Objective

      Students will be able to:

      • Designate access and visibility constraints to classes, data, constructors, and methods
      • Designate private visibility of instance variables to encapsulate the attributes of an object
    4. 5.2 Constructors

    5. Description

      In this lesson, students will expand their knowledge of constructors. They will create constructors that take objects as a formal parameter. This lesson corresponds with AP Computer Science A topic 5.2.

    6. Objective

      Students will be able to:

      • Define instance variables for the attributes to be initialized through the constructors of a class
    7. 5.3 Documentation with Comments

    8. Description

      In this lesson, students will learn how to document their programs using comments. Comments are important to programming because they allow others to easily interpret and use the program code correctly. They can also be used as a debugging tool. This lesson corresponds with AP Computer Science A topic 5.3.

    9. Objective

      Students will be able to:

      • Describe the functionality and use of program code through comments
    10. 5.4 Accessor Methods

    11. Description

      In this lesson, students will examine accessor methods in more detail. This lesson corresponds with AP Computer Science A topic 5.4.

    12. Objective

      Students will be able to:

      • Define behaviors of an object through non-void methods without parameters written in a class
    13. 5.5 Mutator Methods

    14. Description

      In this lesson, students will examine mutator methods in more detail. Mutator methods are often void methods used to change the value of instance and static variables. This lesson corresponds with AP Computer Science A topic 5.5.

    15. Objective

      Students will be able to:

      • Define behaviors of an object through void methods with or without parameters written in a class
    16. 5.6 Writing Methods

    17. Description

      In this lesson, students will examine writing classes in more detail. It is a good programming practice to avoid altering objects within methods unless the method specifically calls for alterations to the object. Accessor and getter methods make obvious changes to objects, but most methods should not attempt to make changes unless it?s explicitly necessary. This lesson corresponds with AP Computer Science A topic 5.6.

    18. Objective

      Students will be able to:

      • Discuss changes to both primitive and reference formal parameters in methods
    19. 5.7 Static Variables and Methods

    20. Description

      In this lesson, students will take a deeper look at static variables and methods. Static variables belong to the class, and all objects of a class share a single static variable. This lesson corresponds with AP Computer Science A topic 5.7.

    21. Objective

      Students will be able to:

      • Define behaviors of a class through static methods
      • Define the static variables that belong to the class.

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Mod-2 Programmers use code to represent a physical object or nonphysical concept, real or imagined, by defining a class based on the attributes and/or behaviors of the object or concept. (LO’s 2.A, 2.B, 2.C, 2.D, 2.E, 2.F, 2.G)

      • EU Mod-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. (LO’s 3.A)

    22. 5.8 Scope and Access

    23. Description

      In this lesson, students will learn about scope and access. The placement of a variable within a program affects the scope of the variable, meaning where it can be used and accessed in a program. Students will learn how to avoid scope and access errors by using method decomposition. This lesson corresponds with AP Computer Science A topic 5.8.

    24. Objective

      Students will be able to:

      • Explain where variables can be used in the program code
    25. 5.9 this Keyword

    26. Description

      In this lesson, students will learn how the this keyword can be used in programs. The keyword this is a reference to the current object whose methods and constructors are being called. This lesson corresponds with AP Computer Science A topic 5.9.

    27. Objective

      Students will be able to:

      • Evaluate object reference expressions that use the keyword this
    28. 5.10 Ethical and Social Implications of Computing

    29. Description

      In this lesson, students will explore several areas related to the ethical and societal implications of computing systems. This includes the professional computing code of ethics, system reliability, legal issues and intellectual property concerns, and bias in computing. This lesson corresponds with AP Computer Science A topic 5.10.

    30. Objective

      Students will be able to:

      • Explain the ethical and social implications of computing systems
    31. 5.11 Writing Classes Quiz

    32. Description
    33. Objective
  6. Array

    1. 6.1 Array

    2. Description

      In this lesson, students will learn about and create arrays. The use of array objects allows multiple related items to be represented using a single variable. This lesson corresponds with AP Computer Science A topic 6.1.

    3. Objective

      Students will be able to:

      • Represent collections of related primitive or object reference data using one-dimensional (1D) array objects
    4. 6.2 Traversing Arrays

    5. Description

      In this lesson, students will learn how to traverse arrays. Iteration statements can be used to access all the elements in an array. This is called traversing the array. This lesson corresponds with AP Computer Science A topic 6.2.

    6. Objective

      Students will be able to:

      • Traverse the elements in a 1D array
    7. 6.3 Enhanced for Loop for Arrays

    8. Description

      In this lesson, students will take a look at enhanced loops. An enhanced for loop is an alternate method to traverse an array instead of using for or while loops. This lesson corresponds with AP Computer Science A topic 6.3.

    9. Objective

      Students will be able to:

      • Traverse the elements in a 1D array object using an enhanced for loop
    10. 6.4 Developing Algorithms Using Arrays

    11. Description

      In this lesson, students will learn how arrays are used to develop algorithms. They will examine common techniques used in array analysis. This lesson corresponds with AP Computer Science A topic 6.4.

    12. Objective

      Students will be able to:

      • Recognize and identify common algorithms that utilize array traversals

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.I)

      • EU Var-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. (LO’s 2.A, 2.B, 2.C)

    13. 6.5 Array Quiz

    14. Description
    15. Objective
  7. ArrayList

    1. 7.1 ArrayList

    2. Description

      In this lesson, students will learn about and use ArrayLists. ArrayLists are similar to arrays, except that they are a mutable list of object references. ArrayLists provide a convenient way to create adjustable arrays. This lesson corresponds with AP Computer Science A topic 7.1.

    3. Objective

      Students will be able to:

      • Represent collections of related object reference data using ArrayList objects
    4. 7.2 ArrayList Methods

    5. Description

      In this lesson, students will learn and use methods that allow the state of ArrayLists to be altered. These methods are as follows:

      • boolean add(E obj)
      • void add(int index, E obj)
      • E get(int index)
      • int size()
      • E set(int index, E obj)
      • E remove(int index)

      This lesson corresponds with AP Computer Science A topic 7.2.

    6. Objective

      Students will be able to:

      • Use methods associated with ArrayLists
    7. 7.3 Traversing ArrayLists

    8. Description

      In this lesson, students will learn how to traverse ArrayLists. For ArrayLists, instead of using .length and brackets ([]) to access the elements in a list, size() and get() will be used. This lesson corresponds with AP Computer Science A topic 7.3.

    9. Objective

      Students will be able to:

      • Traverse ArraysLists using a for or while loop
      • Access elements in an ArrayList using iteration statements
      • Remove elements in an ArrayList
    10. 7.4 Developing Algorithms using ArrayLists

    11. Description

      In this lesson, students will develop algorithms using ArrayLists. They will examine standard algorithms for removing and inserting elements while traversing an ArrayList. This lesson corresponds with AP Computer Science A topic 7.4.

    12. Objective

      Students will be able to:

      • Identify standard ArrayLists algorithms such as inserting and deleting elements
      • Modify standard ArrayLists algorithms
      • Develop an ArrayLists algorithm
    13. 7.5 Searching

    14. Description

      In this lesson, students will explore and analyze a linear search. Linear Search is an algorithm that searches data sets in a sequential order, checking each value from the 0th index to the end of the data set to see what index a specific element can be located at. This lesson corresponds with AP Computer Science A topic 7.5.

    15. Objective

      Students will be able to:

      • Apply linear search algorithms to search for specific information in array or ArrayList objects
    16. 7.6 Sorting

    17. Description

      In this lesson, students will students will explore and analyze Selection Sort and Insertion Sort. Selection Sort swaps the minimum value left in an array with the current array index. Insertion Sort shifts the already sorted section of an array to place the current array value in the correct index. This lesson corresponds with AP Computer Science A topic 7.6.

    18. Objective

      Students will be able to:

      • Apply selection sort and insertion sort algorithms to sort the elements of array or ArrayList objects
      • Compute statement execution counts and informal run-time comparison of sorting algorithms

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.J, 2.K, 2.L, 2.M)

      • EU Var-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. (LO’s 2.D, 2.E)

    19. 7.7 Ethical Issues Around Data Collection

    20. Description

      In this lesson, students will discuss the ethical issues around how and why data is collected. They will look at the risks to personal privacy when working on computer systems and the internet and discuss how computer programs can have beneficial and/or harmful impacts on personal security. Lastly, the importance that programmers have in terms of safeguarding personal privacy will be considered and emphasized. This lesson corresponds with AP Computer Science A topic 7.7.

    21. Objective

      Students will be able to:

      • Explain the risks to privacy from collecting and storing personal data on computer systems
      • Explain the role that programmers have considering safeguarding personal privacy
      • Explain the beneficial and harmful impacts that computer use and the creation of programs have on personal security
    22. 7.8 ArrayList Quiz

    23. Description
    24. Objective
  8. 2D Array

    1. 8.1 2D Arrays

    2. Description

      In this lesson, students will explore and use 2D arrays. A 2D array is an array that stores arrays! This lesson corresponds with AP Computer Science A topic 8.1.

    3. Objective

      Students will be able to:

      • Represent collections of related primitive or object reference data using two-dimensional (2D) array objects
    4. 8.2 Traversing 2D Arrays

    5. Description

      In this lesson, students will extend their learning on 2D arrays by traversing through them. When attempting to access all elements in a 2D array, we can do so in two different ways. Row-major order traverses the 2D array by accessing each value in a row before moving to the next row and column-major order traverses each column down all rows before moving to the next column. This lesson corresponds with AP Computer Science A topic 8.2.

    6. Objective

      Students will be able to:

      • Traverse 2D arrays using nested for loops
      • Traverse 2D arrays using nested enhanced for loops

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.N)

      • EU Var-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. (LO’s 2.F, 2.G)

    7. 8.3 2D Array Quiz

    8. Description
    9. Objective
  9. Inheritance

    1. 9.1 Inheritance

    2. Description

      In this lesson, students will learn about superclasses and subclasses. A superclass is a parent class that contains common attributes and behaviors used by subclasses (children). Subclasses can draw upon the existing attributes and behaviors of the superclass without repeating these in the code. This lesson corresponds with AP Computer Science A topic 9.1.

    3. Objective

      Students will be able to:

      • Create an inheritance relationship from a subclass to the superclass
    4. 9.2 Writing Constructors for Subclasses

    5. Description

      In this lesson, students will write constructors for subclasses. The superclass constructor can be called from the first line of a subclass constructor by using the keyword super and passing appropriate parameters. This lesson corresponds with AP Computer Science A topic 9.2.

    6. Objective

      Students will be able to:

      • Write constructors for subclasses
    7. 9.3 Overriding Methods

    8. Description

      In this lesson, students will learn how to override methods in a superclass/subclass relationship. Method overriding occurs when a public method in a subclass has the same method signature as a public method in the superclass. This lesson corresponds with AP Computer Science A topic 9.3.

    9. Objective

      Students will be able to:

      • Override a method in a superclass/subclass relationship
    10. 9.4 super Keyword

    11. Description

      In this lesson, students will use the super keyword. This keyword can be used to call a superclass?s constructors and methods even if the method has been overridden. This lesson corresponds with AP Computer Science A topic 9.4.

    12. Objective

      Students will be able to:

      • Use the super keyword to call a superclass’s constructors and methods
    13. 9.5 Creating References Using Inheritance

    14. Description

      In this lesson, students will create references using inheritance hierarchies. An object can take on different forms depending on its implementation. Java can call the correct method even when an object is disguised as a more generic reference type. This is known as polymorphism. This lesson corresponds with AP Computer Science A topic 9.5.

    15. Objective

      Students will be able to:

      • Define reference variables of a superclass to be assigned to an object of a subclass in the same hierarchy

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Mod-3 When multiple classes contain common attributes and behaviors, programmers create a new class containing the shared attributes and behaviors forming a hierarchy. Modifications made at the highest level of the hierarchy apply to the subclasses. (LO’s 3.B, 3.C)
    16. 9.6 Polymorphism

    17. Description

      In this lesson, students will take a deeper dive into Polymorphism. At compile time, methods in or inherited by the declared type determine the correctness of a non-static method call. At run-time, the method in the actual object type is executed for a non-static method call. This lesson corresponds with AP Computer Science A topic 9.6.

    18. Objective

      Students will be able to:

      • Call methods in an inheritance relationship
    19. 9.7 Object Superclass

    20. Description

      In this lesson, students will call and use the Object superclass. The Object class is the superclass of all other classes in Java. This lesson corresponds with AP Computer Science A topic 9.7.

    21. Objective

      Students will be able to:

      • Call Object class methods through inheritance
      • Utilize the Object class through inheritance
    22. 9.8 Inheritance Quiz

    23. Description
    24. Objective
  10. Recursion

    1. 10.1 Recursion

    2. Description

      In this lesson, students will learn about recursion and recursive methods. A recursive method is a method that calls itself. Recursive methods contain at least one base case, which halts the recursion, and at least one recursive call. This lesson corresponds with AP Computer Science A topic 10.1.

    3. Objective

      Students will be able to:

      • Determine the result of executing recursive methods

      Enduring Understandings

      This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?

      • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.O)
    4. 10.2 Recursive Searching

    5. Description

      In this lesson, students will examine and apply recursive searching such as the binary search. The binary search algorithm starts at the middle of a sorted array or ArrayList and eliminates half of the array or ArrayList in each iteration until the desired value is found or all elements have been eliminated. This lesson corresponds with AP Computer Science A topic 10.2.

    6. Objective

      Students will be able to:

      • Apply recursive search algorithms to information in String, 1D array, or ArrayList objects
    7. 10.3 Recursive Sorting

    8. Description

      In this lesson, students will use recursive methods to sort an array called Merge Sort. Merge sort is a recursive sorting algorithm that can be used to sort elements in an array or ArrayList. This lesson corresponds with AP Computer Science A topic 10.3.

    9. Objective

      Students will be able to:

      • Apply recursive algorithms to sort elements of an array or ArrayList objects
    10. 10.4 Recursion Quiz

    11. Description
    12. Objective
  11. Introduction to Programming in Java with Karel the Dog

    1. 11.1 Introduction to Programming With Karel

    2. Description

      In this lesson, students are introduced to CodeHS and how Karel the Dog can be given a set of instructions to perform a simple task.

    3. Objective

      Students will be able to…

      • Write their first Karel program by typing out all of the Karel commands with proper syntax

      • Explain how giving commands to a computer is like giving commands to a dog

    4. 11.2 More Basic Karel

    5. Description

      Students learn more about Karel and Karel’s world. Students learn about walls in Karel’s world, the directions Karel can face, and how to identify a location in Karel’s world using streets and avenues. In these exercises, students will begin to see the limitations of Karel’s commands. Students will need to apply Karel’s limited set of commands to new situations. For example, how can we make Karel turn right, even though Karel does not know a turnRight command?

    6. Objective

      Students will be able to…

      • Identify the direction that Karel is facing
      • Predict what direction Karel will be facing after executing a series of commands
      • Identify a location in Karel’s world using Street, Avenue terminology
    7. 11.3 Java Programs and the Run Method

    8. Description

      This lesson introduces the run method, which is the place where the program starts running. Students will also learn to write full java program, instead of just writing commands. In the the program below, SquareKarel is the name of the class. When we say extend Karel, it means this is a Karel program like the ones we have already written.

      public class SquareKarel extends Karel 
      {
          public void run()
          {
              putBall();
              move();
              turnLeft();
         } 
    9. Objective

      Students will be able to…

      • Explain the purpose of the Run Method
      • Explain the first thing that happens in your program when you click the Run button.
      • Write a fully-formed Java program by including a class and a run method.
    10. 11.4 Karel Can't Turn Right

    11. Description

      Students will learn how they can create their own commands for Karel by calling and defining methods. Methods allow programmers to create and reuse new commands that make code more readable and scalable.

    12. Objective

      Students will be able to…

      • Define a method, and successfully implement methods in their code.
      • Teach Karel a new command by creating a turnRight() method
    13. 11.5 Methods in Karel

    14. Description

      Methods are used to teach Karel a word or command. Using methods allows students to break down their programs into smaller pieces and make it easier to understand.

    15. Objective

      Students will be able to…

      • Create methods to teach Karel new commands
      • Explain the difference between defining and calling a method
      • Utilize these methods to write higher level Karel programs that go beyond the basic toolbox of commands that Karel starts with
    16. 11.6 Top Down Design and Decomposition in Karel

    17. Description

      In this lesson, students learn about Top Down Design and Decomposition. Top Down Design is the process of breaking down a big problem into smaller parts.

    18. Objective

      Students will be able to:

      • Break a large problem down into smaller, simpler problems
      • Write methods that solve the simpler problems, and use them as building blocks to solve the larger problem
      • Compare programs and identify good vs poor decomposition
    19. 11.7 Commenting Your Code

    20. Description

      In this lesson, students learn how to style their programs by including comments. Comments allow students to leave notes on their program that makes it easier for other to read. Comments are written in plain English.
      Commenting Your Code Example:

      /*
       *  multi-line  comments
       */
      
      // single line comments
    21. Objective

      Students will be able to…

      • Explain the preconditions and postconditions of a method
      • Create clear and readable comments in their code that help the reader understand the code
      • Explain the purpose of comments
    22. 11.8 Super Karel

    23. Description

      In this lesson, students are introduced to Super Karel! Since commands like turnRight() and turnAround() are so commonly used, students shouldn’t have to define them in every single program. This is where SuperKarel comes in. SuperKarel is just like Karel, except SuperKarel already knows how to turnRight and turnAround, so students don’t have to define those methods anymore. To use SuperKarel instead of Karel, the class that students write extends SuperKarel instead of Karel:

      public class MyProgram extends SuperKarel 
      {
      
      }
    24. Objective

      Students will be able to…

      • Write programs that use SuperKarel instead of Karel
      • Utilize the new toolbox of commands that SuperKarel provides over Karel
      • Read documentation to understand how to use a library (SuperKarel is an example of this)
    25. 11.9 For Loops

    26. Description

      In this lesson students learn how to use for loops in their programs. The for loop allows students to repeat a specific part of code a fixed number of times.

      For loops are written like this:

      for(int i = 0; i < 4; i++)
      {
          // Code to be repeated 4 times
      }
    27. Objective

      Students will be able to…

      • Create for loops to repeat code a fixed number of times
      • Explain when a for loop should be a used
      • Utilize for loops to write programs that would be difficult / impossible without loops
    28. 11.10 While Loops in Karel

    29. Description

      In this lesson, students are introduced a new type of loop: while loops. While loops allow Karel to repeat code while a certain condition is true. While loops allow students to create general solutions to problems that will work on multiple Karel worlds, rather than just one.

    30. Objective

      Students will be able to…

      • Explain the purpose of a while loop
      • Create while loops to repeat code while a condition is true
      • Utilize while loops to solve new types of problems
      • Test their solutions on different Karel worlds
    31. 11.11 If Statements

    32. Description

      In this lesson, students learn about the conditional statement “if”. Code within an “if statement” will only execute IF the condition is true.

      if (frontIsClear()) {
          // Code to be executed only if front is clear
      }
    33. Objective

      Students will be able to…

      • Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
      • Create if statements that only execute code if a certain condition is true
    34. 11.12 If/Else Statements

    35. Description

      In this lesson we take a look at more conditional statements, more specifically if/else statements. If/else statements let us do one thing if a condition is true, and something else otherwise.

      We write if/else statements like this:

      if(frontIsClear())
       {
            // code to execute if front is clear
       }
       else
       {
            // code to execute otherwise
       }
      
    36. Objective

      Students will be able to…
      * Explain the purpose of an If/Else statement
      * Create If/Else statements to solve new types of problems
      * Identify when an If/Else statement is appropriate to be used

    37. 11.13 Control Structures Example

    38. Description

      In this lesson we take a look at control structures. Some control structures allow us to ask questions: if, if / else statements. Other control structures allow us to repeat code like for loops and while loops. Basically, control structures allow us to control the way the commands execute.

    39. Objective

      Students will be able to…
      * Identify the different control structures we can use to modify the flow of control through a program
      * Combine control structures to solve complicated problems
      * Choose the proper control structure for a given problem

    40. 11.14 More Karel Examples and Testing

    41. Description

      In this lesson, we review more lesson in Karel and get extra practice with control structures. Students will continue to see different ways that the if, if/else, while, and for loops affect their code and what Karel can do.

    42. Objective

      Students will be able to…
      * Analyze a solution to a problem and explain why it works
      * Use control structures to create general solutions that work on all Karel worlds

    43. 11.15 How to Indent Your Code

    44. Description

      In this lesson, we review how student should indent their code to make it easier to read. Indenting helps to show the structure of the code.

    45. Objective

      Students will be able to…
      * Explain why it is important to indent code
      * Identify proper indentation
      * Modify a program to have proper indentation
      * Write programs with proper indentation

    46. 11.16 Karel Challenges

    47. Description

      It’s time to put it all together! Students have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this lesson, students will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

    48. Objective

      Students will be able to…
      * Define a problem in their own words and plan out a solution to the problem
      * Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
      * Utilize the proper control structures to create general solutions that solve multiple Karel worlds
      * Write clear and readable code using control structures, methods, decomposition, and comments

    49. 11.17 Unit 1 Quiz

    50. Description

      This lesson is a summative assessment of the unit’s learning objectives.

    51. Objective

      Assess student achievement of the learning goals of the unit

  12. AP Test Practice

    1. 12.1 AP Practice Test 1

    2. Description

      This lesson is a practice exam that prepares students for the AP Computer Science A exam in May. Like the AP Exam, this lesson consists of a multiple choice test that assesses the learning objectives of the course, as well as free response questions that require students to read a prompt, understand the problem, plan a solution, and write clear and readable code that solves the problem.

    3. Objective

      Students will be able to…

      • Explain the format of the AP Computer Science A exam
      • Identify course topics that they have a strong understanding of
      • Identify course topics that they need to review
  13. Java Pretest

    1. 13.1 Java Pretest

    2. Description
    3. Objective
  14. Java Posttest

    1. 14.1 Java Posttest

    2. Description
    3. Objective
  15. Teacher Feedback

    1. 15.1 Teacher Feedback

    2. Description
    3. Objective
  16. Additional Exercises

    1. 16.1 Unit 3

    2. Description
    3. Objective
    4. 16.2 Unit 4

    5. Description
    6. Objective
    7. 16.3 Unit 5

    8. Description
    9. Objective
    10. 16.4 Unit 7

    11. Description
    12. Objective
  17. Elevens

    1. 17.1 Elevens

    2. Description
    3. Objective
  18. Magpie

    1. 18.1 Magpie Lab

    2. Description
    3. Objective
  19. Picture Lab

    1. 19.1 Picture Lab

    2. Description
    3. Objective
  20. Consumer Review Lab

    1. 20.1 Introduction

    2. Description
    3. Objective
    4. 20.2 Sentiment Value and Star Ratings

    5. Description
    6. Objective
    7. 20.3 Autogenerated Review

    8. Description
    9. Objective
    10. 20.4 Create a Negative or Positive Review

    11. Description
    12. Objective
    13. 20.5 Open Ended Activity!

    14. Description
    15. Objective
  21. Celebrity Lab

    1. 21.1 Activity 1: Introduction to Celebrity

    2. Description
    3. Objective
    4. 21.2 Activity 2: The Celebrity Class: A Simple Version

    5. Description
    6. Objective
    7. 21.3 Activity 3: Putting it All Together

    8. Description
    9. Objective
    10. 21.4 Activity 4: Extending the Celebrity Class

    11. Description
    12. Objective
    13. 21.5 Activity 5: Open Ended Activity

    14. Description
    15. Objective
  22. Steganography Lab

    1. 22.1 Activity 1: Exploring Color

    2. Description
    3. Objective
    4. 22.2 Activity 2: Hiding and Revealing a Picture

    5. Description
    6. Objective
    7. 22.3 Activity 3: Identifying a Hidden Picture

    8. Description
    9. Objective
    10. 22.4 Activity 4: Hiding and Revealing a Text Message

    11. Description
    12. Objective
    13. 22.5 Activity 5: Open Ended Project

    14. Description
    15. Objective
  23. Deprecated Activities 08/25/21