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.
Students will be able to:
System.out.print
and System.out.println
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.
Students will be able to:
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.
Students will be able to:
%
)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.
Students will be able to:
+=
, ?=
, *=
, /=
, %=
) in place of the assignment operator++
) or decrement operator (??
) to add 1 or subtract 1 from the stored value of a variableIn 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();
Students will be able to:
This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?
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.
Students will be able to:
int
value must be in the range from Integer.MIN_VALUE
to Integer.MAX_ VALUE
inclusiveIn 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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that?
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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.
Students will be able to:
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: