Chapter 2 Flashcards
algorithm
Statements that describe how a problem is solved in terms of the actions to be executed, and specify the order in which these actions should be executed. Algorithms can help the programmer plan a program before writing it in a programming language.
assignment operator
(=) Assigns a value to a variable
Assignment statement
A simple statement that assigns a value to a variable using an assignment operator (=). When a value is assigned to a variable, it replaces the previous value of the variable, which is destroyed.
Byte type
A primitive data type that represents an integer in a byte. The range of a byte value is from 2^7(-128) to (2^7)-1 (127)
Casting
The process of converting a primitive data type value into another primitive type.
Data type
Used to declare variables to indicate what kind of value the variable can hold.
declare variables
Declares a variable with a data type.
decrement operator
(–)
double type
A primitive data type that represents double precision floating-point numbers with 14 to 15 significant digits of accuracy.
expression
Represents a computation involving values, variables, and operators, which evaluates to a value.
final keyword
A modifier that specifies a constant.
float type
A primitive data type that represents single precision floating-point numbers with 6 to 7 significant digits of accuracy. The double type is used to represent double precisions with 14 to 15 significant digits of accuracy.
floating-point number
A number that includes a fractional part.
identifier
A name of a variable, method, class, interface, or package.
Increment Operator
(++)
incremental coding and testing
A programming methodology that develops and tests programs incrementally. This approach is efficient and productive. It helps eliminate and isolate errors.
int type
A primitive data type that represents an integer in the range from -2^31 (-2147483648) to (2^31)-1 (2147483647
IPO
Stands for Input, Process, Output
literal
A constant value that appears directly in the program. A literal may be numeric, character, boolean, or null for object type.
long type
A primitive data type to represent an integer in the range from -2^63 to (2^63)-1
narrowing a type
Casting a variable of a type with a larger range to a variable of a type with a smaller range.
operand
Are the values operated by an operator.
operator
Operations for primitive data type values. Examples of operators are +, -, /, and %.
overflow
When a variable is assigned a value that is too large (in size) to be stored, it causes overflow.
postdecrement
Refers to the syntax such as x– where the – operator is placed after a variable.
postincrement
Refers to the syntax such as x++ where the ++ operator is placed after a variable.
predecrement
Refers to the syntax such as –x where the – operator is placed before a variable.
preincrement
Refers to the syntax such as ++x where the ++ operator is placed before a variable.
primitive data type
The primitive data types are byte, short, int, long, float, double, boolean, and char.
pseudocode
Describes the program logic using natural language mixed with some programming code.
requirements specification
Is a formal process that seeks to understand the problem that the software will address and to document in detail what the software system needs to do.
scope of a variable
Is the part of the program where the variable can be referenced.
short type
A primitive data type that represents an integer in the range from -2^15 (-32768) to (2^15)-1 (32767)
specific import
Specifies a single class in the import statement. For example, import java.util.Scanner imports Scanner from package java.util.
system analysis
Seeks to analyze the data flow and to identify the systems input and output. When you do analysis, it helps to identify what the output is first, and then to figure out what input data you need in order to produce the output.
system design
Is to design a process for obtaining the output from the input. This phase involves the use of many levels of abstraction to break down the problem into manageable components and design strategies for implementing each component.
underflow
When a floating-point number is too small (i.e. too close to zero) to be stored, it causes underflow. Java approximates it to zero, so normally you don’t need to be concerned about underflow.
UNIX epoch
January 1, 1970 GMT is known as the UNIX epoch because 1970 was the UNIX operating system was introduced.
variable
Variables are used to store data and computational results in the program.
widening a type
Casting a variable of a type with a smaller range to a variable of a type with a larger range.
Wildcard import
Imports all the classes in a package. For example, import.java.util* imports all classes from package java.util.
Named constant
A variable declared final in Java. A local constant is a constant declared in side a method.
Final
A modifier that specifies a constant.