Unit I: Introduction to Programming

Table of Contents

1. Computer Programs & Languages

A Computer Program is a precise set of instructions given to a computer to perform a specific task.


2. Levels of Programming Languages

Programming languages are categorized based on their distance from the computer hardware.


3. Compiler and Interpreter

High-level code must be translated into machine code for execution.

Feature Compiler Interpreter
Translation Translates the entire program at once. Translates the program line-by-line.
Execution Speed Faster, as translation is done before running. Slower, as translation happens during execution.
Error Reporting Lists all errors after scanning the whole file. Stops execution at the first error found.

4. Core Programming Terms

Essential terminology used in software development:


5. Errors in Computer Programs

Errors, or "bugs," prevent a program from working correctly.

Types of Errors:

Exam Tips


Frequently Asked Questions

Q: Why do we need High-level languages if the computer only understands binary?
High-level languages are easier for humans to write, read, and maintain. Compilers take care of the translation into machine code.

Q: Does a warning stop my program from running?
No, a program can still run with warnings, unlike errors which prevent compilation. However, it is best practice to fix warnings to avoid unpredictable behavior.