1/23
Flashcards generated from lecture notes on problem-solving, program design, algorithms, data types, and control structures.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Algorithm
A step-by-step set of instructions to solve a problem or complete a task.
Finite Steps (Algorithm Characteristic)
The algorithm must have a limited number of steps; it cannot go on forever.
Precise (Algorithm Characteristic)
Each step must be clear and well-defined.
Unambiguous (Algorithm Characteristic)
There should be no confusion; every step must be easily understood.
Flow of Control (Algorithm Characteristic)
Steps must follow a logical sequence, moving from one step to the next in order.
Terminate (Algorithm Characteristic)
The algorithm must eventually stop after completing the task.
Variable
A container that holds information, and its value can change while a program is running.
Constant
A container that holds information, but its value never changes.
Integer Data Type
Whole numbers (e.g., 5, 10, -3).
Floating Point Data Type
Numbers with decimals (e.g., 3.5, 10.25, -2.7).
Character Data Type
A single letter, digit, or symbol (e.g., ‘A’, ‘5’, ‘$’).
Boolean Data Type
Only True or False.
String Data Type
A group of characters (words, sentences).
IPO Chart
A tool to break down a system or a program into its three main components: Input, Process, Output.
Input (IPO)
The data or information that is entered into the system.
Process (IPO)
The actions or computations performed on the input to transform it.
Output (IPO)
The result or information produced after processing.
Pseudocode
A way of writing algorithms in a format that is easy to understand, using simple English-like commands.
IF-THEN (Conditional Branching)
Used when there is only one condition to check.
IF-THEN-ELSE (Conditional Branching)
Used when there are two possible outcomes.
Nested IF (Conditional Branching)
Used when there are multiple conditions to check (IF inside another IF).
FOR Loop
Used when the number of repetitions is known.
WHILE Loop
Used when a condition must be met to continue.
REPEAT-UNTIL Loop
Used when you want to execute the block at least once, then check the condition at the end.