Computational Thinking Flashcards

(31 cards)

1
Q

What is abstraction?

A

Process of removing unnecessary detail and focusing on the important features of a problem so that it becomes easier to understand and solve.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is abstraction used in computer science?

A
  • Reduces complexity
  • Makes problems easier to solve
  • Allows systems to be understood at different levesl
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is representational abstraction?

A

Removes excess detail to create a simplified model of a problem that only includes key features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is abstraction by generalisation?

A

Identifying common patterns between problems so that one general solution can solve multiple similar problems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is data abstraction?

A

Hdes the internal representation of data and only exposes the operations that can be performed on it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are abstraction layers?

A

Divide a system into levels where each layer hides the complexity of the layer below it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give examples of abstraction layers.

A

Examples include programming languages (high-level language to machine code) and networking models such as TCP/IP layers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Give advantages of abstraction.

A

Reduces program complexity, allows focus on key features, improves system design, and makes programs easier to maintain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is thinking ahead in program design?

A

Thinking ahead involves considering inputs, outputs, constraints, and possible errors before writing an algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are inputs?

A

Inputs are data provided to a system that are required for processing, such as keyboard input, sensor data, or file data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are outputs?

A

Outputs are results produced by a program after processing input data, such as displayed results or printed reports.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What must programmers consider about inputs and outputs?

A

Input method, output method, data types used, and data structures used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a precondition?

A

A precondition is a condition that must be true before a program or function can run correctly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Give an example of a precondition.

A

Before popping from a stack the stack must not be empty; before pushing the stack must not be full.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why are preconditions useful?

A

They simplify program design, reduce debugging, improve reliability, and make subroutines reusable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are reusable components?

A

Reusable components are program modules that can be used in multiple programs without modification.

17
Q

Give examples of reusable components.

A

Functions, procedures, classes, and abstract data types.

18
Q

Give advantages of reusable components.

A

Already tested so more reliable, reduces development time, reduces cost, and improves productivity.

19
Q

What is procedural thinking?

A

Procedural thinking involves breaking a problem into ordered steps that can be executed sequentially.

20
Q

What is problem decomposition?

A

Problem decomposition is breaking a complex problem into smaller manageable sub-problems.

21
Q

Why is problem decomposition useful?

A

It simplifies complex problems, allows tasks to be divided among programmers, improves debugging, and improves organisation.

22
Q

What is top-down design?

A

Top-down design starts with the overall problem and repeatedly breaks it into smaller sub-problems.

23
Q

What is another name for top-down design?

A

Stepwise refinement.

24
Q

What is stepwise refinement?

A

Progressively breaking a problem into smaller steps until each step can be implemented as a single task or subroutine.

25
What is a subroutine?
A self-contained section of code that performs a specific task.
26
What are advantages of subroutines?
Reusable, easier debugging, improved readability, and supports modular programming.
27
What must programmers consider when combining subroutines?
The order of execution, the data passed between modules, and how modules interact.
28
What is modular programming?
Designing software using separate modules that each perform a specific task.
29
Advantages of modular programming?
Easier maintenance, easier debugging, reusable modules, and supports teamwork.
30
How do modules communicate?
Modules communicate through parameters and return values passed between subroutines.
31
Why must programmers anticipate errors when thinking ahead?
To handle invalid input, boundary cases, or unexpected situations and ensure the program runs reliably.