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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to: