Theme 3. Mathematical modeling. Computer Mathematics Systems
3. Languages and programming environments
Programming languages - the system of notation for the accurate recording of the algorithm, which is understood for the PC.
Programming languages are largely reminiscent of ordinary languages - English or Ukrainian and consist of words, phrases, syntactic rules.
Write a program - translate the algorithm into a programming language, a receptive PC.
The same algorithm can be translated into different programming languages.
Programming languages are divided into:
- Algorithmic (procedural) - languages that describe the problem solving algorithm using a list of procedures, such as Basic, Pascal, C, Logo, and others;
- functional - description of the model of the subject area by means of a hierarchy of functions, for example, the language Lisp;
- logical - a description of the model of the domain by means of mathematical logic, for example, the language Prolog, SmallTalk.
Programming can be divided into:
- Visual programming is a means by which you can quickly create an application by visualizing its layout graphically, such as Visual C, Visual Basic, Delphi.
- high-level languages - consists of operators that are similar to ordinary words;
- Low-level language (assembler) - translates symbols (mnemonic) in person into machine codes.
Translation from the programming language into machine codes is carried out by translators - translation programs.
There are two possible broadcasts:
- compiler - translates the whole program, after which it is executed;
- interpreter - translates part of the program (line) and executes it immediately.
The language of Si and its environment
Language X was created in 1972 by Denis Ritchie to develop the operating system UNIX.
After publishing in the book "The Programming Language of Si" in 1978, C language becomes a popular language for applied and system programming, since it has a compact way of recording expressions and a wide range of operators.
In the language of C, a graphical AutoCAD system, Windows operating system, and more.
Advantages of C language:
- power - performing a maximum of work for a small number of steps;
- portability - the ability to implement Xi on different computers;
- popularity - has a million programmers who use this language;
- development - is constantly supplemented and expanding its capabilities at the expense of libraries of functions, new operators.
A structured approach to programming
For better software development, a structured approach to programming is used.
Each subproblem corresponds to an independent software module - which, as a rule, the module implements one function and returns the control of the module that called it.
The source code of the program must be clearly divided into blocks:
1) a brief explanation of the purpose of the module, its method of call, output data and the result of its work, date of creation, etc .;
2) description of all the variables used in this module;
3) the algorithm for solving the problem;
4) processing the results of the problem.
Structural programming - a method of writing the text of the program based on the use of basic structures for managing the calculation process: linear, branching, and loop.
In this approach, the program code (program functions) and data are separated.
Functions determine what is going on over the data, but not vice versa.
Testing - the process of finding errors:
- analysis of program work in a given range of output data or extreme data;
- program response to incorrect output;
- the interaction between modules, etc.
Object-Oriented Programming
OOP - a method of programming that allows you to consider the conceptual model as a set of objects.
OOP is implemented in Visual C ++, Delphi and other environments.
The basis of the OOP is a new object (data type) - class. The class consists of a set of variables (data) and operations (methods = class member functions) that work only with these variables.
A number of basic terms are associated with the PLO:
- Encapsulation is a way of combining data and functions (methods) into a single structure. In C ++ classes, the functional elements of the object are used with private, public, protected.
- Hierarchy of classes. Objects created on the basis of the class description are called instances of the class. You can build a hierarchy of classes that consist of a parent class and several child classes. Parent classes represent common problems, and derived classes implement more specific tasks.
- IThe implication(inheritance) - the ability of the class to imitate the features of other classes. The parent class is used for a derived class instance, which can be changed in different ways.
- Polymorphism - the concept of an OOP, in which the same message can be sent to the parent class and the objects of the derived classes. Each subclass object responds in some way to the format of the message, as appropriate, to its description.
Font Face
Font Size
Text Colour
Background Colour
Font Kerning
Image Visibility
Letter Spacing
Line Height
Link Highlight