Vocabulary
- algorithm
- a step by step plan for solving a particular problem.
- memory
- the component in a computer that holds a program while it is
executing and all of the data that is being used. Memory is made up
of millions of cells; each cell is called a byte (composed of 8
bits) and is large enough to hold one character.
- address (memory address)
- each cell in memory has an address, which is used to refer to
that cell. To get data from memory, a program gives the address of
the cell that holds the data. To put data into memory, a program
gives the address of the cell which will hold the data.
In higher level languages, programmers use identifiers
instead of addresses to access memory.
- variable
- a name for a memory location that can hold a value.
The value of a variable can be changed during execution of the
program.
- type (data type)
- defines a set of values with similar characteristics
and the operations that may be performed on those values.
Some examples of types are are int, float, and char.
Some operations defined for int and float are addition
and subtraction.
- identifier
- name for some construct within a program, such as
the name for a variable, constant, or function.
- constant (literal)
- a specific value, such as the number 15, the
number 22.9, the character 'a', or the string "The answer is"
- named constant
- identifier that is given a constant value. The value
of the identifier cannot be changed during execution of the
program. Example:
const float taxrate=0.22;
- declaration
- a statement that defines a variable or named constant
by specifying the name and type for the variable or constant.
The declaration causes the compiler to allocate memory for
the variable or constant, and associates the name and type
with that memory location.
Example:
int length;
char letter;
float price;
- initialization
- the assignment of a value to a variable or named constant
at the time of declaration. If a variable is not initialized
then it contains garbage (some random, unpredictable value)
until a value is stored in the variable by an assignment
statement or cin statement. Example:
int sum = 0;
const float pi = 3.14159;
- operator
- a symbol or identifier that represents an action, such as +
(for addition) and * (for multiplication).
- operand
- the value that an operator acts upon. For example, in
num * 15, the operator is * and the operands are num
and 15.
- expression
- any combination of variables, constants, operators, and function
calls that can be evaluated to yield a result
- arithmetic expression
- an expression that contains arithmetic operators and which
evaluates to a number.
- logical expression (boolean expression)
- an expression that contains logical operators and which
evaluates to either true (1) or false (0).
- assignment statement
- statement that stores a new value into the variable on the
left side of the assignment operator (=). The new value can come from a
variable or constant, an arithmetic expression, or a function call.
Examples:
count = 0;
area = length * width;
tax = taxOwed(income, taxrate);
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2002