Programming Logic and Design
Chapter 1 Key Terms Questions and
Answers
exception - ANSWER-a problem or change in conditions that causes the
microprocessor to stop what it is doing and handle the situation in a separate routine.
An exception is similar to an interrupt; both refer the microprocessor to a separate
set of instructions.
expression - ANSWER-a combination of symbols—identifiers, values, and operators
—that yields a result upon evaluation. The resulting value can then be assigned to a
variable, passed as an argument, tested in a control statement, or used in another
expression.
flowchart - ANSWER-a graphic map of the path of control or data through the
operations in a program or an information-handling system.
for loop - ANSWER-Combines the three elements of iteration—the initialization
expression, the termination condition expression, and the counting expression—into
more readable code.
foreach loop - ANSWER-Useful for iterating through the elements of a collection.
garbage collection - ANSWER-a process for automatic recovery of heap memory.
heap - ANSWER-a portion of memory reserved for a program to use for the
temporary storage of data structures whose existence or size cannot be determined
until the program is running. To build and use such elements, programming
languages such as C and Pascal include functions and procedures for requesting
free memory from the heap, accessing it, and freeing it when it is no longer needed.
In contrast to stack memory, heap memory blocks are not freed in the reverse order
in which they were allocated, so free blocks maybe interspersed with blocks that are
in use. As the program continues running, the blocks may have to be moved around
so that small free blocks can be merged together to form larger ones to meet the
program's needs.
if - ANSWER-A statement that executes a given sequence of statements only if the
corresponding Boolean expression evaluates to true.
if-else - ANSWER-A statement that allows your program to perform one action if the
Boolean expression evaluates to true and a different action if the Boolean expression
evaluates to false.
iterate - ANSWER-to execute one statements or a block of statements repeatedly.
Statements so executed are said to be in a loop.
Chapter 1 Key Terms Questions and
Answers
exception - ANSWER-a problem or change in conditions that causes the
microprocessor to stop what it is doing and handle the situation in a separate routine.
An exception is similar to an interrupt; both refer the microprocessor to a separate
set of instructions.
expression - ANSWER-a combination of symbols—identifiers, values, and operators
—that yields a result upon evaluation. The resulting value can then be assigned to a
variable, passed as an argument, tested in a control statement, or used in another
expression.
flowchart - ANSWER-a graphic map of the path of control or data through the
operations in a program or an information-handling system.
for loop - ANSWER-Combines the three elements of iteration—the initialization
expression, the termination condition expression, and the counting expression—into
more readable code.
foreach loop - ANSWER-Useful for iterating through the elements of a collection.
garbage collection - ANSWER-a process for automatic recovery of heap memory.
heap - ANSWER-a portion of memory reserved for a program to use for the
temporary storage of data structures whose existence or size cannot be determined
until the program is running. To build and use such elements, programming
languages such as C and Pascal include functions and procedures for requesting
free memory from the heap, accessing it, and freeing it when it is no longer needed.
In contrast to stack memory, heap memory blocks are not freed in the reverse order
in which they were allocated, so free blocks maybe interspersed with blocks that are
in use. As the program continues running, the blocks may have to be moved around
so that small free blocks can be merged together to form larger ones to meet the
program's needs.
if - ANSWER-A statement that executes a given sequence of statements only if the
corresponding Boolean expression evaluates to true.
if-else - ANSWER-A statement that allows your program to perform one action if the
Boolean expression evaluates to true and a different action if the Boolean expression
evaluates to false.
iterate - ANSWER-to execute one statements or a block of statements repeatedly.
Statements so executed are said to be in a loop.