1.3 Expressions Output
1.3.A Develop code to generate output and determine the result that would be displayed.
1.3.A.1 System.out.print and System.out.println display information on the computer display. System.out.println moves the cursor to a new line after the information has been displayed, while System.out.print does not.
1.3.B Develop code to utilize string literals and determine the result of using string literals.
1.3.B.1 A literal is the code representation of a fixed value.
1.3.B.2 A string literal is a sequence of characters enclosed in double quotes.
1.3.B.3 Escape sequences are special sequences of characters that can be included in a string. They start with a \ and have a special meaning in Java. Escape sequences used in this course include double quote \", backslash \\, and newline \n.
1.3.C Develop code for arithmetic expressions and determine the result of these expressions
1.3.C.1 Arithmetic expressions, which consist of numeric values, variables and operators, include expressions of type int and double.
1.3.C.2 The arithmetic operators consist of addition +, subtraction -, multiplication *, division /, and remainder %. An arithmetic operation that uses two int values will evaluate to an int value. An arithmetic operation that uses at leaset one double value will evaluate to a double value.
Exclusion Statement: Expressions that result in special double values (e.g. infinities and NaN) are outside the scope of the AP Computer Science A course and exam.
Last updated
Was this helpful?