Please enable JavaScript to use CodeHS

AP Computer Science A (Nitro)

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.

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
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.

Objective

Students will be able to:

  • Define instance variables for the attributes to be initialized through the constructors of a class
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.

Objective

Students will be able to:

  • Describe the functionality and use of program code through comments
Description

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

Objective

Students will be able to:

  • Define behaviors of an object through non-void methods without parameters written in a class
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.

Objective

Students will be able to:

  • Define behaviors of an object through void methods with or without parameters written in a class
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.

Objective

Students will be able to:

  • Discuss changes to both primitive and reference formal parameters in methods
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.

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)

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.

Objective

Students will be able to:

  • Explain where variables can be used in the program code
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.

Objective

Students will be able to:

  • Evaluate object reference expressions that use the keyword this
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.

Objective

Students will be able to:

  • Explain the ethical and social implications of computing systems