Computational Thinking
1. The Four Pillars
Computational thinking is a mental process used to formulate a problem so that a computer can solve it efficiently.
Breaking a complex problem down into smaller, more manageable parts (sub-problems).
Example: Breaking a "Student Management System" into Login, Grading, and Attendance modules.
Removing unnecessary details to focus on the essential features needed to solve the problem.
Example: Using a "Circle" object with a radius instead of worrying about pixel density or screen resolution.
Looking for similarities or trends within problems to find repeatable solutions.
Example: Noticing that sorting students by name uses the same logic as sorting products by price.
Creating a step-by-step set of instructions (rules) to solve the problem.
Example: Designing the pseudocode for a Binary Search or a Bubble Sort.
2. Practical Application: Building a Voting System
- Decomposition: Split the system into Identity Verification, Vote Recording, and Result Tallying.
- Abstraction: Represent a "Voter" as just a
UserIDandHasVotedboolean. Ignore their address or hair color. - Pattern Recognition: Recognize that counting votes is just an
Accumulatorpattern used in many algorithms. - Algorithmic Thinking: Write the logic for
IF ValidUser THEN RecordVote() ELSE Reject().
3. Structured Programming
To implement these pillars, we use Structured Programming techniques:
- Modularization: Using Procedures and Functions to keep code clean.
- Scope: Understanding Global vs. Local variables.
- Parameter Passing: Moving data into subroutines via
BYVAL(Value) orBYREF(Reference).
In Paper 2, "Abstraction" is the most tested concept. Always ask: "What information is absolutely necessary for this specific algorithm to work?" Everything else should be abstracted away.