Structured program development Flashcards
Algorithm
A procedure for solving a problem in terms of the ordered actions.
Pseudocode
Developing an algorithm using everyday enlgish.
Sequential execution
When statements are normally executed one after another in order in which they’re are written.
Transfer of control
A C statement that allows you to execute a statement that is farther down the source code.
All programs can be written in terms of what?
Sequence (process), selection (if), and iteration (loop) control structures.
Flow chart
A graphical representation of an algorithm.
Diamond symbol
Indicates that a decision is to be made.
If
Single selection statement.
If….else
Double selection statement.
Case (switch)
Multiple selection statement.
What are the 3 types of iteration statements?
1) While loop
2) Do….while loop
3) For loop
Nesting
Allows you to connect multiple control statements.
Decision symbol (rhombus) contains what?
An expression, such as a condition, that can either be true or false.
If decision statement evaluates to 0, it is?
a. True
b. False
False
If decision statement evaluates to non zero, it is?
a. True
b. False
True
If statement is single entry and how many exits?
Single
C provides which operator that is closely related to the if….else statement?
Conditional operator
?:
The conditional operator is C’s only what operator and why?
Ternary operator because it has three operands.
grade >= 60 ? puts(“Passed”) : puts(“Failed”).
A set of statements contained within a a pair of braces is called what?
Compound statement or a block
An uninitialized variable contain a what value?
“Garbage” value because it uses the last stored value in the memory location reserved for that variable.
Sentinel value is also called what?
signal value, dummy value, or a flag value and it indicated the “end of data entry”.
The type float represents what kind of numbers?
Numbers with decimal points called floating point numbers.
When two integers are divided, any fractional part of the result is what?
truncated (lost).
To prevent a rational expression from being truncated you may use what?
unary cast operator (float).
Unary operator takes how many operands?
one
In general, any integer variable that should store only non-negative values should be declared with what?
Unsigned before the integer type.