Chapter 2 Flashcards
Arithmetic expression
An expression constructed using arithmetic operators and numbers
Assignment operator
=; assigns whatever is on the right side to the variable on the left side
Associativity
the associativity of arithmetic operators is said to be from left to right
Binary operator
an operator that has two operands
Cast operator
also known as type conversion or type casting - used to explicitly convert one data type to another data type
Character arithmetic
arithmetic operation on char data
Collating sequence
a predefined ordering for the characters in a set
Compound assignment statement
statements that are used to write simple assignment statements in a more concise notation
Computer program
A sequence of statements whose objective is to accomplish a task
Data type
A set of values together with a set of operations
Declaration statements
Statements that are used to declare things, such as variables
Decrement operator
–; decreases the value of a variable by 1
Double precision
Values of type double
Enumeration
A user-defined data type
Executable statements
statements that perform calculations, manipulate data, create output, accept input, and so on
Floating-point
A data type that deals with decimal numbers
Floating-point expression
An expression in which all operands in the expression are floating-point numbers
Floating-point notation
A form of scientific notation used to represent real numbers
Function
A collection of statements; when activated, or executed, it accomplishes something
Identifier
A C++ identifier consists of letters, digits, and the underscore character (_); it must begin with a letter or underscore
Implicit type coercion
When a value of one data type is automatically changed to another data type
Increment operator
++; increases the value of a variable by 1
Initialized
The first time a value is placed in the variable
Input statement
a statement that places data into variables using cin and»_space;
Integral
a data type that deals with integers, or numbers, without a decimal part
Integral expression
an expression in which all operands are integers
Keyword
a reserved word
Mixed expression
an expression that has operands of different data types
Named constant
a memory location whose content is not allowed to change during program execution
Null string
a string containing no characters
Operands
numbers appearing in an arithmetic expression
Output statement
an output on the standard output device via cout and
Post-decrement
has the syntax variable–
Post-increment
has the syntax variable++
Pre-decrement
has the syntax ?-variable
pre-increment
has the syntax ++variable
precision
the maximum number of significant digits
predefined function
a function that is already written and provided as part of the system
preprocessor
a program that carries out preprocessor directives
programming
the process of planning and creating a program
programming language
a set of rules, symbols, and special words
prompt lines
executable statements that inform the user what to do
reserved words
also known as keywords - word symbols in a programming language that cannot be redefined in any program
run-together word
an identifier that is composed of two or more words that are combined without caps or underscores
self-documenting identifiers
identifiers that describe the purpose of the identifier through the name
semantic rules
rules that determine the meaning of the instructions
semantics
a set of rules that gives meaning to a language
simple assignment statement
a statement that uses only the assignment operator to assign values to the variable on the left side of the operator
simple data type
the variable or named constant of that type can store only one value at a time
single precision
values of type float
source code
consists of the preprocessor directives and program statements
source code file
a file containing source code
statement terminator
the semicolon
stream extraction operator
> > ; takes information from a stream and puts it into a variable
stream insertion operator
string
a sequence of zero or more characters
syntax rules
rules that describe which statements are legal, or accepted by the programming language, and which are not legal
token
the smallest individual unit of a program written in any language
unary operator
an operator that has only one operand
variable
a memory location whose content may change during program execution
walk-through
the process of tracing values through a sequence