1/37
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is problem decomposition?
Breaking a complex problem into smaller, manageable sub-problems.
What is top-down design?
A design approach that starts from the highest level problem and breaks it down into detailed parts.
What is abstraction?
Removing unnecessary detail to focus on the important parts of a problem.
Name two types of abstraction.
Representational abstraction and generalisation.
What is a trace table?
A table used to manually track the values of variables at each step of an algorithm.
Why are trace tables useful?
For debugging and verifying that an algorithm works correctly.
What is structured programming?
A programming paradigm based on sequence, selection, and iteration, using subroutines to improve clarity and reduce complexity.
What are the three basic control structures in structured programming?
Sequence, selection (if/else), and iteration (loops).
What is a subroutine?
A named block of code that performs a specific task, such as a function or procedure.
What is the difference between a function and a procedure?
A function returns a value; a procedure does not.
What is modular programming?
Dividing a program into separate modules or files, each handling a specific part.
What is pseudocode?
A simplified, informal high-level description of an algorithm that uses the structure of programming languages but is not executable.
Why use pseudocode?
To plan and communicate algorithms clearly without worrying about syntax.
What are common pseudocode commands?
INPUT, PRINT, IF, ELSE, ELIF, CASE, FOR, WHILE, REPEAT UNTIL, PROCEDURE, FUNCTION, RETURN.
How do you assign a value in pseudocode?
Using the syntax: variable <- value.
What is the purpose of comments in pseudocode?
To explain code logic, improve readability, and aid debugging.
What is a variable?
A named storage location for data that can change during program execution.
What is a constant?
A fixed value that does not change during program execution.
What is selection in programming?
Decision making, where code branches based on a condition (if-else).
What are iteration structures?
Code that repeats actions; includes loops like FOR, WHILE, and REPEAT UNTIL.
What is the difference between WHILE and REPEAT UNTIL loops?
WHILE tests condition before the loop; REPEAT UNTIL tests after (executes at least once).
Why is testing important in programming?
To find errors and ensure the program works as expected.
What is dry-run testing?
Manually stepping through code or an algorithm to check logic and output.
What is the difference between syntax and logic errors?
Syntax errors break the rules of the programming language; logic errors produce incorrect results but do not crash the program.
What is debugging?
The process of finding and fixing errors in code.
What is the fetch-decode-execute cycle?
The basic operation cycle of a CPU that fetches an instruction, decodes it, and executes it.
Why is decomposition useful in programming?
It makes complex problems easier to solve, debug, and maintain.
What is meant by 'readability' in code?
Code that is easy to read, understand, and modify.
What is a flowchart?
A graphical representation of an algorithm using standard symbols for processes, decisions, inputs, and outputs.
Name some standard flowchart symbols.
Terminator (oval), process (rectangle), decision (diamond), input/output (parallelogram).
What is meant by 'test data'?
Data used to check if a program works correctly.
What are the three types of test data?
Normal (valid), boundary (edge cases), and erroneous (invalid).
What is black-box testing?
Testing without knowledge of internal code, based on input/output only.
What is white-box testing?
Testing based on knowledge of internal program structure.
What is a test plan?
A document outlining what tests will be performed, with inputs, expected outputs, and actual results.
What is an algorithm?
A step-by-step procedure to solve a problem.
What is pseudocode's role in problem solving?
Helps design and communicate algorithms before coding.