CSEC IT Programming Study Notes
CSEC IT Programming Study Notes
2. Programming Languages
- **Low-level languages**: Machine language, Assembly.
- **High-level languages**: Closer to human language; easier to read and write (e.g., Pascal,
Python, C).
Examples:
- Pascal: Often used in CSEC exams.
- Python: Widely used in modern applications.
3. Programming Terms
- **Algorithm**: A step-by-step plan to solve a problem.
- **Variable**: A named space in memory to store a value.
- **Constant**: A value that doesn’t change.
- **Data Types**: Integer, Real, Char, String, Boolean.
4. Control Structures
- **Sequence**: Instructions run one after the other.
- **Selection**: If…Then…Else statements used for decision-making.
- **Iteration**: Loops (For, While, Repeat…Until). Used for repeating tasks.
Example in Pascal:
```
If age > 18 Then
WriteLn('Adult')
Else
WriteLn('Minor');
```
5. Pseudocode and Flowcharts
- **Pseudocode**: Structured English to describe algorithms.
- **Flowcharts**: Diagrams that show the flow of an algorithm using shapes.
- Oval: Start/End
- Parallelogram: Input/Output
- Rectangle: Process
- Diamond: Decision
6. Basic Input/Output
Input allows users to enter data; Output displays results.
Pascal example:
```
Var name: String;
Begin
Write('Enter your name: ');
ReadLn(name);
WriteLn('Hello ', name);
End.
```