1. What is a program?¶
A detailed set of instructions, step by step, that tells the computer what to do.
If we change the program, the computer will do something different
The computer remains the same, but the program has changed.
Programs are executed.
Software (programs) controls hardware.
The process of creating software is called programming.
An algorithm is a step-by-step recipe for solving a computational problem.
1.1. Programming languages¶
- Low-level languages are the closest to the machine:
- Assembler:
Load the number of variables A into the CPU.
Load the number of variables B into the CPU.
Add the two numbers in the CPU.
Store the result in variable C.
Original high-level language command: C = A + B.
Compilers convert high-level language to specific computer machine language.
Interpreters parse and execute the program instruction by instruction in the computer’s machine language.