3.2 THE FUNCTIONING OF COMPUTERS 62 Can you give the definition of an algorithm? Do you know any more flowchart symbols? ONLINE RESOURCES The binary system and units of measure WHAT IS A COMPUTER PROGRAM? A computer program is a sequence of instructions written in a specific programming language that directs computer systems to perform a specific task. Programs are written by programmers on the basis of specific requirements and goals they want to achieve. Computer programs consist of algorithms and databases. Algorithms are the building blocks of programs and the set of steps to carry out a task. Databases are organised collections of information and data stored in the computer system. A simple example of algorithm and database is a recipe: the algorithm is the set of instructions you have to follow to prepare the recipe, the database is the collection of ingredients you need. The programmer is the chef who writes the recipe in the language the computer can understand. How to write a program Writing a program is a complex operation that must follow a strict sequence of operations. The three basic points to start from are: Describe the mission: what is the function/operation that has to be carried out? Define the end user: who will use the program? Decide the machine: what kind of computer will run the program? to achieve: raggiungere to debug: eseguire il debug to encode: codificare to figure out: risolvere to fix: riparare, correggere to involve: coinvolgere path: percorso to outline: delineare recipe: ricetta strict: rigido Steps of program writing Writing a computer program involves: writing code, i.e. the set of instructions written in a particular programming language; testing code, i.e. checking if it works according to the specifications; debugging, i.e. fixing any programming mistake. Flowcharts When the task description is defined, the programmer prepares a flowchart, which is a diagram (or map) that shows step-by-step the entire process in a sequential order. The flowchart normally uses symbols to represent the different types of instructions and outline the path the workflow must take to complete the task. After writing the flowchart, the program instructions are encoded in a specific programming language, then tested and finally debugged. Symbols of flowcharts There are twenty-eight flowchart symbols that go from simple, basic operations to more complex ones. These are the five basic symbols: Start / End point The oval represents the beginning / end of the process. Input / Output The parallelogram represents input information or output results. Connector The arrow represents the relationship between steps. Process The rectangle represents the process of an operation. Decision The diamond indicates the decision a certain action takes. 138 iNforMaTioN TechNology Elettronica-Informatica.indb 138 25/01/24 16:08