1.
Programming & Programs
● Programming: The process of designing and building an executable computer program
to accomplish a specific computing result or perform a specific task. Think of it as
"writing the instructions."
● Program: A collection of instructions that can be executed by a computer to perform a
specific task. If programming is the act of cooking, the program is the final recipe.
2. Planning Tools: Pseudocode & Flowcharts
Before writing actual code, programmers use these tools to map out logic:
● Pseudocode: A detailed yet readable description of what a computer program or
algorithm must do, expressed in formally styled natural language rather than in a
programming language.
● Flowchart: A visual representation of a sequence of steps or a process. It uses different
shapes (like diamonds for decisions and rectangles for actions) to show the "flow" of the
program.
3. Language Rules: Syntax vs. Semantics
● Syntax: The set of rules that defines the combinations of symbols that are considered to
be correctly structured statements in a language. (Like grammar in English).
● Semantics: The meaning of the code. A sentence can be syntactically correct but
semantically nonsense (e.g., "The colorless green ideas sleep furiously").
4. Basic Structure of a Program
Most programs follow a logical sequence often referred to as IPO:
1. Input: Taking data from the user or a file.
2. Process: Performing calculations or logic on that data.
3. Output: Displaying the result to the screen or saving it.
5. Variables & Operators
● Variable: A "container" or a named space in the computer's memory used to store data
that can be changed during program execution. (e.g., score = 10).
● Operator: Symbols that tell the computer to perform specific mathematical or logical
manipulations.
○ Arithmetic: +, -, *, /
○ Comparison: == (equal to), > (greater than), < (less than)
6. Control Structures: Conditionals & Loops
These determine the "path" the code takes:
● Conditional (If-Statements): Allows the program to make decisions. "If this condition is
true, do Action A; otherwise, do Action B."
● Loops: Used to repeat a block of code multiple times until a certain condition is met.
○ For Loop: Used when you know how many times you want to repeat.
○ While Loop: Used when you want to repeat until something changes.