Chapter 3 Flashcards
Define an algorithm
An algorithm is a precise sequence of steps to produce a result.
A program is an encoding of an algorithm in a language to solve a particular problem.
Define a value
A value is a data item that is manipulated by the computer.
Define a variable or identifier
A variable or identifier is the name that the programmer uses to refer to a location in memory.
catbox
Define datatype
A datatype is the type of data stored at a location in memory.
Define location
A location has an address in memory and stores a value.
IMPORTANT: The value at a given location in memory (named using a variable name) can change using
IMPORTANT: The value at a given location in memory (named using a variable name) can change using
initialization or assignment.
IMPORTANT: The value at a given location in memory (named using a variable name) can change using
IMPORTANT: The value at a given location in memory (named using a variable name) can change using
initialization or assignment.
Syntax that represents permanent data that doesn’t change.
named constant
final datatype CONSTANTNAME = VALUE;
final double PI = 3.14159;
final int SIZE = 3;
CONSTANTNAME = CAPS
Byte
(-128 to 127)
8 bit range
short
16 bit range
long
64 bit signed
float
32-bit less precise
double
64 bit more precise