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
inclusive