problem solving - topic 1

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/37

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

38 Terms

1
New cards

What is problem decomposition?

Breaking a complex problem into smaller, manageable sub-problems.

2
New cards

What is top-down design?

A design approach that starts from the highest level problem and breaks it down into detailed parts.

3
New cards

What is abstraction?

Removing unnecessary detail to focus on the important parts of a problem.

4
New cards

Name two types of abstraction.

Representational abstraction and generalisation.

5
New cards

What is a trace table?

A table used to manually track the values of variables at each step of an algorithm.

6
New cards

Why are trace tables useful?

For debugging and verifying that an algorithm works correctly.

7
New cards

What is structured programming?

A programming paradigm based on sequence, selection, and iteration, using subroutines to improve clarity and reduce complexity.

8
New cards

What are the three basic control structures in structured programming?

Sequence, selection (if/else), and iteration (loops).

9
New cards

What is a subroutine?

A named block of code that performs a specific task, such as a function or procedure.

10
New cards

What is the difference between a function and a procedure?

A function returns a value; a procedure does not.

11
New cards

What is modular programming?

Dividing a program into separate modules or files, each handling a specific part.

12
New cards

What is pseudocode?

A simplified, informal high-level description of an algorithm that uses the structure of programming languages but is not executable.

13
New cards

Why use pseudocode?

To plan and communicate algorithms clearly without worrying about syntax.

14
New cards

What are common pseudocode commands?

INPUT, PRINT, IF, ELSE, ELIF, CASE, FOR, WHILE, REPEAT UNTIL, PROCEDURE, FUNCTION, RETURN.

15
New cards

How do you assign a value in pseudocode?

Using the syntax: variable <- value.

16
New cards

What is the purpose of comments in pseudocode?

To explain code logic, improve readability, and aid debugging.

17
New cards

What is a variable?

A named storage location for data that can change during program execution.

18
New cards

What is a constant?

A fixed value that does not change during program execution.

19
New cards

What is selection in programming?

Decision making, where code branches based on a condition (if-else).

20
New cards

What are iteration structures?

Code that repeats actions; includes loops like FOR, WHILE, and REPEAT UNTIL.

21
New cards

What is the difference between WHILE and REPEAT UNTIL loops?

WHILE tests condition before the loop; REPEAT UNTIL tests after (executes at least once).

22
New cards

Why is testing important in programming?

To find errors and ensure the program works as expected.

23
New cards

What is dry-run testing?

Manually stepping through code or an algorithm to check logic and output.

24
New cards

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.

25
New cards

What is debugging?

The process of finding and fixing errors in code.

26
New cards

What is the fetch-decode-execute cycle?

The basic operation cycle of a CPU that fetches an instruction, decodes it, and executes it.

27
New cards

Why is decomposition useful in programming?

It makes complex problems easier to solve, debug, and maintain.

28
New cards

What is meant by 'readability' in code?

Code that is easy to read, understand, and modify.

29
New cards

What is a flowchart?

A graphical representation of an algorithm using standard symbols for processes, decisions, inputs, and outputs.

30
New cards

Name some standard flowchart symbols.

Terminator (oval), process (rectangle), decision (diamond), input/output (parallelogram).

31
New cards

What is meant by 'test data'?

Data used to check if a program works correctly.

32
New cards

What are the three types of test data?

Normal (valid), boundary (edge cases), and erroneous (invalid).

33
New cards

What is black-box testing?

Testing without knowledge of internal code, based on input/output only.

34
New cards

What is white-box testing?

Testing based on knowledge of internal program structure.

35
New cards

What is a test plan?

A document outlining what tests will be performed, with inputs, expected outputs, and actual results.

36
New cards

What is an algorithm?

A step-by-step procedure to solve a problem.

37
New cards

What is pseudocode's role in problem solving?

Helps design and communicate algorithms before coding.

38
New cards