Current location - Recipe Complete Network - Complete cookbook - The concept of program
The concept of program
The program tells the computer how to complete the calculation task. Calculations here can be mathematical operations, such as solving equations, or symbolic operations, such as finding and replacing a word in a document. Fundamentally speaking, a computer is an operation machine composed of digital circuits, which can only operate on numbers. The reason why the program can perform symbolic operation is because symbols are also represented by numbers inside the computer. In addition, programs can also process sounds and images, which are inevitably represented by numbers in computers. These numbers are converted into sounds and images that people can hear and see through special hardware equipment.

The program consists of a series of basic operations, as follows:

Input (input)

Get data from a keyboard, file or other device.

Output (output)

Display the data on the screen, or save it in a file, or send it to other devices.

Elementary operation

The most basic data access and mathematical operations (addition, subtraction, multiplication and division).

Testing and branching

Test a condition, and then perform different subsequent operations according to different test results.

spread

Repeat a series of operations.

Any program you have used, no matter how complicated, is executed step by step according to these basic operations. The program is so complicated, but the basic operations that can be used to write the program are only so simple, and the huge gap between them will be filled by programmers, so writing the program should be a rather complicated job. Programming can be said to be a process of decomposing a complex task into subtasks, and then decomposing subtasks into simpler tasks, layer by layer, until it is simple enough to be completed by the above basic operations.