до тех пор, пока
оған дейін, әзір
A computer program. Creating a program
Methods of creating programs.
Stages of program planning
Algorithms and their features
A tool for program development
Phase of the transmission and execution of
Translation and its phase
Modular programming, layout
Compilation and interpretation
The essence of the lexical analysis. The
essence of the parser. Formal grammar
The First Few steps in Pascal Programming
Variables, Constants and the Assignment
7. Пәнді оқытудың әдістемелік нұсқаулығы
Бұл курс информатиканың негізгі пәндеріне қосымша пән ретінде жүргізіледі.
Алдыңғы курстардың жалғасы ретінде негізінен бағдарламалау тілдерін терең меңгеруге
Бұл пән бойынша толық мәтінді қосымшалар жасаудың қасиеттері, әдістері мен
бағдарламалау тілдерінің компоненттерін толық меңгереді.
алған білімдерін практика жүзінде іске асырады. Студенттердің алған білімдері СОБӨЖ
және СӨЖ кезінде өздік жұмыстар арқылы ауызша түрде тексеріледі.
Курс барысында әртүрлі есептерді шешудегі әдістер мен тәсілдерге басты назар
бағдарламаларын құру арқылы алған білімдерін бекітеді.
device of the computer . The program - one of the components of the software . Depending on the
context, considered the term may also refer to the source code of the program. Computer
programs, as an object of intellectual property , is classified as intangible assets .
The program - the data intended for the management of specific components of information
processing in order to implement a specific algorithm .
The program - presented in the form of an objective set of data and commands designed to
operate computers and other computing devices in order to obtain a certain result, including the
preparatory material produced during the development of computer programs and audiovisual
displays generated by.
an executable (single file or group of files). From this image, typically located on the disk, the
executable program in memory can be built software loader .
In system programming there is a more formal definition
[ citation needed 1017 days ]
of the program
as offered in the computer memory data and the machine code executed by the processor to
achieve a certain goal. It highlights two things: finding a program in memory and its
execution processor .
Software development process consists of several stages, of which in the narrow sense only
direct creation of software code called "programming ". In everyday life under the programming
often means the whole software development process, and the people involved in this activity are
called programmers .
Record source programs using programming languages easier to understand and edit the
person. This, in particular, help to comments that are valid in the syntax of most languages. To
run the computer prepared text of the program is converted ( compiled ) into machine code .
Some programming languages allow you to dispense with pre-compile and translate it into
machine code instructions directly at runtime. This process is called dynamic compilation , and it
allows for greater portability between different hardware and software platforms while
maintaining the many advantages compilation.
Interpretive programs, which usually does not apply to the process of compiling and
interpreted by the operating system or a special interpreter program, called scripts , or
The source code of computer programs in most programming languages consist of a list of
description of the source and the desired characteristics of the processed data and providing the
choice of a suitable algorithm for solving the specialized program-interpreter - an approach
called declarative programming . By declarative programming are functional and Boolean , as
well as less common types of programming.
Methods of creating programs.
Here we consider one of the most important issues: how to create the program?
So far we have dealt with relatively small programs to solve simple algorithmic problems. We
met with the importance and role of the specification of the program, clear statement of the main
steps of the algorithm for data processing, translation of these steps in an effective sequence of
have seen that verify the correctness of the program is necessary, even when correctly used the
algorithm has been proved. Moreover, we note that the internal organization of the programs that
we have written so far, can be represented in the form of a'le Pascal as in Fig. 13.1.
The development of large software development is different from the low in two major respects.
Source code for solving large problems takes a lot more space than one page.
The creation of such programs by writing Pascal programs "with the list" is almost impossible.
Typically, this involves developing a systematic approach:
description of the problem;
writing a program.
Established program should be readable, efficient and correct.
Creating a program - a systematic process consisting of specific phases. In this process, we have
the program. Since we want to get the program
clear to understand, that is, readable;
efficient, ie economize on resources and the artist performed them quickly;
correct, ie contains no errors;
it is not any process of creating a program for us.
We need a method of creating clear, appropriate, effective programs.
Clarity means that anyone who is familiar with the language Pascal, and the application domain,
the algorithm will understand by reading the program text, comments, and the specification of the
Efficiency implies that the algorithm and program are designed to minimize the possible
resources of the computer system necessary for its decision.
Correctness means that any execution of the program with a valid baseline data gives the correct
we obtain the desired product with the desired characteristics.
Let's write a small program, concentrating now our attention on the process of its creation. Let us
have asked to write a program in Pascal, which places the components of a vector in ascending
order. Suppose that after communication with the customer, we found that:
components of the vector can only be positive integers;
components is always 100;
All components are distinct.
Stages of program planning
The solution to any problem on the computer is processing data through the program. Creating
such a program includes a series of successive stages:
formulation of the problem;
mathematical description and choice of method;
Development of an algorithm for solving;
testing and debugging programs;
exploitation of the program.
The first stage is the formulation of the problem. At this stage, the problem is formulated
objective, defined the relationship with other tasks, revealed the composition and format of the
input, intermediate and result data are characterized by the form and methods to control the
reliability of information at key stages of solving the problem, determined the form of user
interaction with computers in the solution and m . etc.
In the second phase development of the program is executed formal description of the program,
ie established and formulated into the language of mathematics and mathematical logic
relationship between the source and Scoring data. For tasks that allow the possibility of
mathematical description, choose a numerical method of solution, and for non-numeric tasks -
concept solutions in the form of unambiguous sequence of execution of elementary mathematical
The third stage training solution is algorithmization its solution, iedevelopment or adaptation of
the famous original algorithm.Algorithmic - a complex process that bears heavily
creative.Formulation of the problem and its algorithmization up to 20-30% of the total time to
develop the program. The complexity and responsibility of this stage due to the fact that to solve
the same problem, as a rule, there are many different algorithms.
Algorithm - is the exact prescription, defining the computational process, leading to varying the
initial data to the desired result. This is a finite set of rules, clearly revealing the content and
sequence of operations for the systematic solution of a certain class of problems in a finite
number of steps.
The fourth stage - drawing up the program. At this stage, the translation of the description of the
algorithm on one of the available computer description languages.
Testing and Debugging constitute the final stage of the development program to deal with the
problem on a computer. Both these processes are functionally linked, although their goals are
somewhat different from each other.
Testing is a set of actions designed to demonstrate the correct operation of the program. The
purpose of testing is to identify possible errors in the developed programs by checking them on a
set of predefined test cases.
The testing process is accompanied by the debugging process, which involves a set of actions
aimed at fixing bugs in the program. Steps to start debugging since the discovery of the facts
wrong and end of the program eliminating the causes of errors.
After completing the process of testing and debugging tools, along with supporting
documentation sent to the user to operate. The main purpose of the documentation - provide the
user with the necessary guidance for the program.
The concept and features of the algorithms
"Algorithm" - one of the fundamental concepts of computer science and mathematics. The
origin of the term is associated with a distorted view (Algorithmi) the name of a medieval Arab
mathematician, Mohammed al-Khwarizmi (787 - 850). At the time, called algorithms described in
the treatises of al-Khwarizmi's rules of arithmetic (addition, subtraction, multiplication and
division area column of multi-digit numbers) and the decimal system.
Currently, the concept of the algorithm is interpreted widely. This concept applies to all
areas of human activity.
The algorithms are found not only in computer science, but also in everyday life. Examples
of algorithms of everyday life:
• a trip to the Institute;
• repair the TV (for instruction);
• Search for missing items;
• cultivation of plants in the area, etc.
Not all problems can be solved using algorithms. For example, writing music, writing
poetry, scientific discovery. The computer is used to solve only those problems for which the
algorithm can be made.
Any algorithm has the following properties:
Determinacy (certainty) signifies that the algorithm set of guidelines should be clearly
understood by any performer. This property determines the uniqueness result of the algorithm for
a given input data.
The mass of the algorithm suggests the possibility of varying the input data within certain
limits. This property determines the suitability of an algorithm for solving a set of specific
problems of a certain class.
number of steps (or iterations) to complete its work.
Readability of the algorithm means that you can split some of the algorithmic process of the
individual elementary steps, the possibility of realizing that a person or a computer is not in
doubt, as the result of each elementary step is completely defined and understood.
Thus, the algorithm makes it possible to mechanically solve any specific problem of a class
of similar problems. There are several ways to describe the algorithms:
• formal, verbal,
• Graphics and others
The verbal way of describing the algorithm reflects the content of actions performed by
means of natural language. The advantages of this method, the description should include its
accessibility, as well as the ability to describe with any degree of detail. To the main
disadvantages of this method should include sufficient description of the cumbersome, due to the
lack of a rigorous formalization of the perception of ambiguity of natural language.
The formal-verbal way of describing an algorithm based on the content of records actions
performed with the use of figurative language features of mathematics, supplemented to indicate
the required disclosures by means of natural language. This way, having all the advantages of a
verbal way, along with the more concise, and therefore more obvious, has a greater formalization,
but also is not strictly formal.
Graphic way of describing the algorithm represents the image of the logical-mathematical
structure of the algorithm, in which all stages of data processing are represented by a specific set
of geometric shapes (blocks) having a well defined configuration in accordance with the nature of
The tools used to create programs
To create a program or software used by the hardware and software.
Under the hardware usually know all the nodes, modules and components that make up a
computer or computer system. In modern computers, so-called "open architecture", ie of
computer hardware can be changed by changing one of the modules, or extend by inserting an
Hardware modern PCs include the following:
• the system unit,
• input device to a PC (eg, keyboard)
• output device information from the PC (for example, the monitor).
The system unit, keyboard and monitor together make up a PC with minimal configuration,
ie allow you to work with the information on your computer.
The essence of the lexical analysis
Lexical analysis (LA) is the first phase of translation. The term "language" in common parlance
means the rules of making words from letters. In a programming language LA corresponds to the
phase of translation, in which a sequence of individual letters (symbols, letters, language) are
allocated words (tokens, symbols, the next phase - parsing). Typical words in a programming
language are components such as comments, identifiers, constants, function words SIGNS OF
LA is the simplest and most formal phase of translation. Any algorithm based on the aircraft
serial viewing of text, with the return and re-reading of the input sequence by no more than one
character, so the program is sometimes called the LA Scanner.The formal basis for describing the
process of LA are finite state machines.