Chapter 8 - Definitions Flashcards
Define algorithm
A step-by-step process for solving a category of problems
Define body
The indented statements after a heading ending in a colon, for instance after a for-loop heading
Define counter
A variable used to count something, usually initialized to zero and incremented in the body of a loop
Define cursor
An invisible marker that keeps track of where the next character will be printed
Define definite iteration
A loop where we have an upper bound on the number of times the body will be executed. Definite iteration is best coded as a for loop.
Define escape sequence
An escape character, \, followed by one or more printable characters used to designate a non printable character
Define generalise
To replace something that is unnecessarily specific (like a constant value) with something appropriately general (like a variable or parameter). Generalisation makes code more versatile, more likely to be reused, and sometimes even easier to write.
Define infinite loop
A loop in which the terminating condition is never satisfied
Define indefinite iteration
A loop where we just need to keep going until some condition is met. A while statement is used for this case.
Define iteration
Repeated execution of a set of programming statements
Define loop
A statement or group of statements that execute repeatedly until a terminating condition is satisfied
Define loop variable
A variable used as part of the terminating condition of a loop
Define nested loop
A loop inside the body of another loop
Define newline
A special character that causes the cursor to move to the beginning of the next line
Define reassignment
Making more than one assignment to the same variable during execution of a program