Computer Programming 1 Flashcards
(21 cards)
Repeats a block of statements while given condition evaluates to true.
While
Expression enclosed in parenthesis.
Loop Condition
Statements enclosed in curly braces.
Loop Body
A loop that continues to execute endlessly.
Infinite Loop
A variable whose value determines whether loop execution continues.
Loop Control Variable
Executes a sequence of statements multiple times and abbreviates the code that manages the loop varaible.
For
Indicates the starting value for the loop control variable.
Initialization
The loop condition that controls the loop entry, and the update is the expression that alters the loop control variable.
Condition
Similar to a while loop, except that it executes the loop body first before evaluating the expression.
Do…while
This statement terminates the loop or switch statement and transfers the flow of the program to the statements following the loop or switch.
Break
This statement causes the loop to skip the remainder of the body and immediately reevaluate its condition, and proceeds with the next iteration of the loop.
Continue
Control statements that are placed within another.
Nested Control Structures
In this, the program executes particular statements depending on the given condition.
Selection Structure
In this, the program repeatss particular statements a certain number of times, depending on the given condition.
Repetition Structure
These are any kind of statements grouped together within curly braces.
Compound Statements or Block Statements
Incorporated using the if statement.
One-Way Selection
Are used to choose between two alternatives.
Two-Way Selection
When one control statement, either selection or repetition, is located within another.
Multiple Selections
Allows a program to perform multiple selections.
Nested if
A process in which the computer evaluates a logical expression from left to right and stops as soon as the value of the expression is determined.
Short-Circuit Evaluation
Allows a single variable to be tested for equality against a list of values, depending on its value, executes a certain block of statements.
Switch Statement