Every topic starts at New. Sign in and your practice counts.
A computer program is a set of instructions written in a programming language that directs a computer to perform a specific task or solve a particular problem. When a program is run, the computer follows these instructions step by step to produce the desired output.
Examples of computer programs:
| Term | Definition |
|---|---|
| Program | A single set of instructions written to perform a specific task |
| Software | A broader term that includes one or more programs, along with documentation and configuration data |
In simple terms, all programs are software, but not all software is a single program. For example, Microsoft Office is software that contains multiple programs (Word, Excel, PowerPoint).
A programmer (also called a developer or coder) is a person who:
Programmers use languages such as Python, C++, Java, and others to communicate instructions to the computer.
Computers only understand machine language, which consists of binary code, sequences of 0s and 1s. Every instruction a programmer writes in a high-level language (like Python) must eventually be translated into binary for the CPU to execute.
Levels of programming languages:
MOV, ADD); translated by an assemblerWhen a program runs, the CPU follows the Fetch-Decode-Execute cycle:
Programs must be loaded into RAM (main memory) before the CPU can execute them. The program stored on disk is copied into RAM at runtime.
Computer programming is important because it:
Before writing actual code, a good programmer plans the solution. This is a key skill in computational thinking.
An algorithm is a step-by-step procedure for solving a problem. It must be:
Pseudocode is an informal, plain-language description of an algorithm. It is not actual code, it has no strict syntax rules, but it describes the logic clearly.
Example: Write pseudocode to find the larger of two numbers.
START
INPUT number1
INPUT number2
IF number1 > number2 THEN
PRINT number1, "is larger"
ELSE
PRINT number2, "is larger"
END IF
END