The cyclic structure of the molecule. Cyclic connections. The orienting action of the substitute

CYCLIC COMPOUNDS (carbocyclic and heterocyclic)

Organic compounds whose molecules contain closed chains (cycles) are called cyclic.

Depending on the nature of the atoms forming the cycle, these substances are divided into carbocyclic and heterocyclic.

Carbocyclic (or isocyclic) compounds contain only carbon atoms in their rings (rings). These compounds, in turn, are divided into alicyclic and arolgic.

ALYCYCLIC CONNECTIONS

Alicyclic compounds are hydrocarbons of cyclic structure, the molecules of which are built of carbon atoms linked together (T-BOND.

In terms of chemical properties, alicyclic compounds are similar to the corresponding compounds of the aliphatic series. Therefore, they received the name "alicyclic" ("aliphatic cyclic" hydrocarbons). However, there are differences between aliphatic and alicyclic compounds, which are explained by the cyclic structure of the latter.

CLASSIFICATION AND NOMENCLATURE OF ALYCYCLIC COMPOUNDS

Classification. Alicyclic compounds may contain

loops of various sizes, from three-term to polynomial. AT

a molecule can contain two cycles at the same time. If these cycles have one carbon atom in common, this is spirans (I), in the presence of two such atoms - compounds with condensed cycle - lsh (II). There are " lousy"compounds that contain a" bridge "in the cycle between two carbon atoms (III):

Depending on the nature of the bonds in the cycles, limiting alicyclic compounds are distinguished - cycloalkanes (cycloparaffins) and unsaturated - cycloalkenes (cycloolefins).

Nomenclature. Alicyclic compounds can be called by adding the prefix cycle- to the name of the corresponding aliphatic hydrocarbon:


The substituents in the ring are numbered so that the sum of these figures is the smallest:

Cycloalkanes are otherwise called polymethylene hydrocarbons or naphthenes.

In cycloalkenes, the double bond is usually denoted by the suffix -en (if two double bonds are present, then -dien). The position of the double bond in the cycle is indicated by the smallest possible numbers:

Isomerism. For alicyclic hydrocarbons and their derivatives, several types of isomerism are possible. So, structural isomerism depends on:

1) on the number of carbon atoms in the ring:


2) on the position of the substituents in the cycle:


With two identical substituents (radicals), geometric ( cystrans-) isomerism. For example, the substituents can occupy different positions relative to the plane of the ring:


In the alicyclic series, an important role is played by conformational (rotary) isomerism.

Many cycles, with the exception of the three-membered one, do not have a planar structure. In space, they can take various forms. This is due to the fact that neighboring CH 2 groups forming a cycle are forced to repel each other, thereby reducing the angular stress in the molecule. This repulsion leads to the fact that the molecule becomes non-flat, forming various shapes in space. For example, cyclobutane is more likely to bend diagonally at an angle


Fig. 35.

(b) up to 160 ° (Fig. 35, a; the bend point is shown by a dotted line). Cyclopentane also has a non-planar structure. The place of deviation from the plane does not remain constant, but moves alternately along its five corners, resembling a wave-like motion (Fig. 35, b). The cyclohexane molecule is bent in space so that for cyclohexane there are two main forms without angular stress - "bath" and "armchair" (Fig. 36). In one of them (chair) carbon atoms are arranged in three in two parallel planes.

Each of the forms of these compounds is a spatial (rotational) isomer.

Figure: 36.

and - chair shape;b - bathtub shape

Fig. 37. Two types of bonds in the cyclohexane molecule ("chair" form)

The individual stable states that a molecule takes in space are called conformations or conformers (rotary isomers). It takes a minimum of energy to move from one conformation to another. Therefore, their selection in free form is almost impossible. However, these isomers have unequal stability and some of them turn out to be energetically more

profitable. So, it was found that

Figure: 38.

the more stable form in cyclohexane is the "chair" form. In a chair-shaped molecule, each carbon atom has two types of bonds: one equatorial (e) and one axial (a) (Fig. 37). The axial bonds are directed along the axis perpendicular to the plane of the cyclohexane ring, while the equatorial bonds lie in this plane and are directed radially from it. This arrangement of links in the form

The “armchair” makes it more advantageous than the “bath,” since in the latter case the hydrogen atoms in positions 1 and 4 are in the “eclipsed” position, which increases the energy of this conformation. In derivatives of cyclohexane, a mutual transition of axial and equatorial bonds is possible (Fig. 38).

  • From Arabic. naphtha - oil. Cyclopentane and cyclohexane derivatives are found in some crude oils.
  • Angular stress is understood as the deviation of the bond angle in the cycle from the tetrahedral (109 ° 28 ").

Recall that all organic compounds are divided into two large groups:

  • open-chain compounds (aliphatic) and
  • cyclic compounds.

Cyclic compounds are characterized by the presence of so-called cycles in their molecules.


A cycle is a closed chain, that is, a chain that, having started at some vertex, ends at it.

Cyclic compounds, in turn, are subdivided into:

  • Carbocyclic compounds
  • - alicyclic compounds,
    - aromatic compounds.

Carbocyclic compounds - these are compounds in the molecules of which there are cycles consisting only of carbon atoms.


In addition to bonding with each other, carbon atoms are also bonded to other atoms (hydrogen, oxygen, etc.), but the cycle itself is made up of carbon atoms. This circumstance is reflected in their name (Carboneum in Latin - carbon).



These are cyclic compounds, in the cycles of which, in addition to carbon atoms, atoms of other elements (oxygen, nitrogen, sulfur, etc.) are present. And this is also reflected in their name (from the Greek ετερος - "different", "different").


In the picture above (right), Pyridine is shown as an example of a heterocyclic compound.

Carbocyclic compounds

Carbocyclic compounds are divided into alicyclic and aromatic.

Alicyclic compounds are one of two subtypes of carbocyclic compounds.


They are called so because in terms of chemical properties they are the closest to aliphatic compounds, although in structure they are ring-shaped.


They differ in the number of carbon atoms in the cycle and, depending on the nature of the bond between these atoms, they can be limiting and unsaturated.


In the molecules of saturated cyclic hydrocarbons, carbon atoms are connected by simple bonds, as in the molecules of saturated hydrocarbons with an open chain, which makes them similar in properties to the latter.


Examples of such compounds are cycloparaffins:



The names of cyclic compounds are constructed similarly to the names of compounds of the fatty (aliphatic) series with the addition of the prefix "cyclo".

The second subspecies of carbocyclic compounds are aromatic compounds.


Aromatic series covers all carbocyclic compounds in the molecules of which there is a specific group of atoms - benzene ring... This grouping of atoms determines the specific physical and chemical properties of aromatic compounds.


The simplest of these are benzene C 6 H 6 and its homologues, for example, toluene (methylbenzene) C 6 H 5 -CH 3, ethylbenzene C 6 H 5 -CH 2 CH 3... The general formula of these compounds C n H 2n-2.



A characteristic feature of the structure of the benzene ring is alternating with each other three simple and three double bonds... For ease of writing, the benzene nucleus is depicted simplified in the form of a hexagon, in which the symbols FROM and Hrelated to the ring do not write:



Monovalent benzene radical C 6 H 5 -, formed when one hydrogen atom is subtracted from any carbon atom of the benzene nucleus, is called phenyl.


Known aromatic hydrocarbons with multiple bonds in the side chains, such as styrene, as well as multinucleated ones containing several benzene nuclei, for example naphthalene and anthracene:



Or simplified:


Obtaining aromatic compounds and their use.


Aromatic hydrocarbons are contained in coal tar obtained from coal coking. Another important source of their production is oil from some fields.


Aromatic hydrocarbons are also produced by catalytic aromatization of acyclic petroleum hydrocarbons.


Some aromatic compounds can be isolated from essential oils plants. They are used to obtain aromatic substances.


Aromatic hydrocarbons and their derivatives are widely used for the production of plastics, synthetic dyes, medicinal and explosive substances, synthetic rubbers, and detergents.


Origin of name.


Benzene and all compounds containing a benzene nucleus were called aromatic (at the beginning of the 19th century), since the first studied representatives of this series were aromatic substances, or compounds isolated from natural aromatic substances. Now this series includes numerous compounds that do not have a pleasant smell, but possess a complex of chemical properties called aromatic properties.


Features of the properties and structure of aromatic hydrocarbons.


The aromatic properties of benzene and its homologues, determined by the peculiarity of its structure, are expressed in the relative stability of the benzene nucleus, despite the lack of composition of benzene.


Thus, unlike unsaturated compounds with ethylene double bonds, benzene is resistant to oxidants. For example, like saturated hydrocarbons, it does not discolor potassium permanganate. Addition reactions are not typical for benzene. On the contrary, for it, as well as for other aromatic compounds, reactions of substitution of hydrogen atoms in the benzene nucleus are characteristic.


It follows from what has been said that the benzene formula with alternating single and double bonds does not accurately express the nature of the bonds between carbon atoms in the benzene nucleus.


In accordance with this formula, benzene should have three localized pi bonds, i.e. three pairs of pi electrons, each fixed between two carbon atoms. If we designate these pi-electrons with dots, then the structure can be represented by the diagram:


However, experience shows that there are no ordinary double bonds in the benzene ring, alternating with simple ones, and that all bonds between FROM-atoms are equivalent.


This equivalence is explained as follows.


Each of the carbon atoms in the benzene ring is in the state sp 2-hybridization and spends three valence electrons for the formation of sigma bonds with two adjacent carbon atoms and one hydrogen atom.


Moreover, all six carbon atoms and all sigma bonds C-C and C-H lie in the same plane:



The cloud of the fourth valence electron of each of the carbon atoms (i.e. the cloud r-electron, not participating in hybridization) has the shape of a three-dimensional figure ("dumbbell") and is oriented perpendicular to the plane of the benzene ring.


Each of these r-electronic clouds overlap above and below the plane of the ring with r-electron clouds of two adjacent carbon atoms.



Density of clouds pi-electrons in benzene is evenly distributed between all bonds C-C... In other words, six pi-electrons are generalized by all carbon atoms of the ring and form a single ring cloud ( aromatic electronic sextet).


For this reason, in the structural formulas, instead of the generally accepted symbol of the benzene nucleus with alternating double and single bonds, a hexagon with a circle inside is used:


Closed-chain compounds that include not only carbon atoms, but also atoms of other elements are called heterocyclic.



Shown in the figure Pyridine can be considered as benzene, in which the group -CH replaced by a nitrogen atom.


- the most numerous class of compounds. These include many vitamins, pigments, antibiotics, most alkaloids, some amino acids, etc.


The elements that participate together with carbon atoms in the formation of the cycle are called heteroatoms... The most widespread and studied heterocyclic compounds of oxygen, sulfur and nitrogen.


A heteromolecule can contain either one heteroatom or a larger number:


Heterocycles can contain three, four, five, six or more atoms. Similar to carbocyclic compounds, five- and six-membered heterocycles are the most stable.



The presence of a heteroatom leads to a violation of the uniformity of the electron density distribution in the cycle. This determines the ability of heterocyclic compounds to react with both electrophilic and nucleophilic reagents (i.e., be both a donor and an acceptor of an electron pair), and also relatively easily undergo ring breaking.

Foreword

“A practical guide to chemistry. Grade 10 "is intended for the study of chemistry in the 10th grade of secondary school according to one of the modern textbooks, for example, according to the book" Chemistry 10-11 "by E.E. Nifantyev and L.A. Tsvetkov. This manual is the third book of practical developments in a four-year chemistry course.
With an undoubted connection with inorganic chemistry, studied in the 8th and 9th grades, organic chemistry (10th grade) is essentially an independent subject. She has her own language, specific terminology, a repetitive cyclical nature of the presentation of material about the connections of different classes. For example, the procedure for studying alkanes is as follows: the composition of compounds, their structure, isomerism, names, reactions of preparation and chemical transformations, application and calculation problems. The same order is used when considering the subsequent classes of organic compounds - alkenes, alcohols, etc.
At its core, the "Practical Guide" is a laconic and accessible presentation of the course in organic chemistry for the 10th grade on two topics: "Hydrocarbons" (14 lessons) and "Oxygen-containing compounds" (22 lessons). Each topic is followed by a test test. The final test of knowledge in the course of organic chemistry of the basic level of education is also offered in the form of tests (31 questions).
Each lesson in this manual begins with a brief theoretical background for a specific question. Considered typical examplesillustrating the material, approaches to solving problems. The lesson ends with exercises (6–8 questions) that control the skills and abilities of the students. Answers to many tasks, including solutions to computational and complex problems, are also given in the manual. The first lessons (№ 1-3, 7-12) include the concepts of organic chemistry, introduced in the 9th grade. These lessons are in the form of a chemical dictation. In the dictation, the names of key terms are indicated only by the first letters and then by dots. Students write such terms on their own.
The manual is designed for schoolchildren with different levels of training. Some will be able to reproduce the examples considered, others will cope with the proposed tasks and similar questions from other sources. As a result of this form of work, students receive the necessary theoretical and practical information that allows them to navigate the main laws of organic chemistry.
This "Practice Guide" will help students learn chemistry. It will be useful for teachers in organizing the educational process and applicants in preparation for university exams.

Topic 1. Hydrocarbons.
Lesson 1. The structure of organic compounds.
Lesson 2. Structural formulas and names of saturated hydrocarbons.
Lesson 3. Isomerism of saturated hydrocarbons.
Lesson 4. Covalent bonds of organic compounds.
Lesson 5. Hybridization of carbon atomic orbitals.
Lesson 6. Classification of reactions in organic chemistry.
Lesson 7. Chemical properties of alkanes.
Lesson 8. Unsaturated hydrocarbons.
Lesson 9. Chemical properties of alkenes.
Lesson 10. Obtaining and using alkenes.
Lesson 11. Dienes. Natural rubber.
Lesson 12. Acetylene and its homologues.
Lesson 13. Aromatic hydrocarbons (arenas).
Lesson 14. Getting, chemical properties and use of benzene.
Lesson 15. Test No. 1 (tests) on topic 1 "Hydrocarbons".

Topic 2. Oxygen-containing compounds.
Lesson 16. Monohydric saturated alcohols.
Lesson 17. Getting alcohols.
Lesson 18. Chemical properties of alcohols.
Lesson 19. The use of alcohols. Chains of chemical transformations involving alcohols.
Lesson 20. Polyhydric alcohols.
Lesson 21. Phenols.
Lesson 22. Tasks on the topic "Alcohols and phenols".
Lesson 23. Aldehydes.
Lesson 24. Chemical properties and application of aldehydes.
Lesson 25. Ketones.
Lesson 26. Carboxylic acids.
Lesson 27. Chemical properties of carboxylic acids.
Lesson 28. Recognition of oxygen-containing substances.
Lesson 29. Esters and other derivatives of carboxylic acids.
Lesson 30. The origin and use of carboxylic acids and esters.
Lesson 31. Genetic relationship of hydrocarbons, their halogen derivatives and oxygen-containing compounds.
Lesson 32. Fats.
Lesson 33. Carbohydrates.
Lesson 34. Cyclic forms of monosaccharides.
Lesson 35. Disaccharides and oligosaccharides.
Lesson 36. Polysaccharides.
Lesson 37. Chemical properties of carbohydrates.
Lesson 38. Control work No. 2 (tests) on the topic "Oxygen-containing compounds".
Lesson 39. Final work "All organic chemistry".
Glossary of terms

It is not given to us to predict
how our word will respond in our hearts.

R. Kazakova

Topic 1. Hydrocarbons

Lesson 1. The structure of organic compounds

Organic chemistry is the science of carbon compounds. Mr. Carbon will guide this guide.
Hydrocarbons are organic compounds consisting of atoms of two elements - y ……. and in ……. ...
The variety of organic compounds is due to the ability of C atoms to form c ..., i.e. connect with each other. Carbon chains are l ……. , p ………… and c ………. ...

Linear chains are those in which all C atoms are located on the same line (straight, broken or twisted). If the C atoms are denoted by dots, and the chemical bonds between the atoms by dashes, then the linear chains look like this:

Branched chains are those in which some C atoms do not fall on the continuous line connecting the largest number of carbon atoms in the molecule. The longest chain of C atoms is called r …… y ……… c… ... To highlight the main carbon chain, its C atoms are numbered. Atoms and groups of atoms not included in the main chain (including heteroatoms * for derivatives of hydrocarbons) associated with the main chain of C atoms are called s ………….

In the conventional abbreviated notation of branched chains, carbon atoms - substituents - will be shown by dots in a circle, and heteroatoms - by chemical symbols.
Examples of branched carbon chains:

Cyclic chains (cycles) contain 3, 4, 5, 6 and more C atoms, closed in a ring. The main chain in cyclic compounds is the carbon atoms of the cycle, and their counting starts from a more complex substituent included in the chain.
Examples of cyclic chains:

Groups of stars in the sky can also be thought of as chains of different types:


Exercise 1.Write down one example of three types of carbon chains: linear, branched, cyclic, each of which would include seven C atoms.

Assignment 2. In the row of chemical symbols, underline heteroatoms: H, Li, C, N, O, F, Cl.

Hydrocarbons of linear and branched structure, all bonds between carbon atoms in which are single (saturated or saturated):

have the name "a ... ..".

General formula alkanes - FROM n H 2 n+2, where n \u003d 1, 2, 3, 4, etc. (any integer). For example, if in a molecule saturated hydrocarbon three carbon atoms ( n \u003d 3), then the number of hydrogen atoms will be eight (2 n + 2 \u003d 2 3 + 2 \u003d 8), the molecular formula of this substance is C 3 H 8. For alkanes with five and fifty C atoms, the molecular formulas are C 5 H ... and C 50 H ....

Alkanes with a cyclic structure (containing a cycle in the molecule) are called c …………. General formula cycloalkanes - FROM n H 2 n ... So, for cyclic hydrocarbons containing five C atoms, the molecular formula will be C 5 H 10. For cyclic chains of composition C 5 H 10, in which the required number of H atoms is indicated at carbon atoms (valence C - IV), the formulas are:

Known unsaturated hydrocarbons.They contain double (C \u003d C) or triple (CC) carbon-carbon bonds, usually along with single (C – C) bonds:

It is interesting that at a single carbon there can be four heteroatomic substituents (structure A), at the edge C atoms of the carbon chain - up to three heteroatomic substituents (structures B 1 –B 3), and at the internal atoms of the chain - one or two substituents (structures B 1 , AT 2):

* All atoms other than C and H are called heteroatoms in organic chemistry, for example, heteroatoms - F, Cl, Br, N, O, etc.

Lesson 2. Structural formulas and names
saturated hydrocarbons

The valency of carbon is ... (figure). Therefore, when writing structural formulas, four dashes should depart from carbon, depicting chemical bonds.
The form of recording the composition of an organic molecule, in which each C atom is shown separately with bonds, is called with ………. f …… ... Chemically bonded carbon atoms represent carbon skeleton molecules of matter.

Three kinds of structural formulas

1. The most complete form of the hydrocarbon formula is when each atom of the molecule is shown separately:

Such a recording is cumbersome, takes up a lot of space and is rarely used.

2. A notation form in which the total number of hydrogen atoms is indicated for each C atom, and dashes are placed between adjacent carbons,
meaning x ……… s…. :

CH 3 –CH 2 –CH 3, Сl – CH 2 –CH 2 –Br.

3. A structural formula in which dashes between atoms located in a record on one line do not indicate, while atoms extending to other lines are connected by dashes with a straight chain:

Sometimes carbon chains are depicted with broken lines, geometric shapes (triangle, square, cube). In this case, at each break in the chain, as well as at the beginning and at the end of the chain, atom C is meant. For example, in the images

correspond to structural formulas

Below are some of the properties of individual saturated hydrocarbons and the forms of their recording (Table 1).

Table 1

Saturated hydrocarbons (alkanes) names of linear structure

Name
alkane
Molecular
formula
Structural
formula
Aggregate
state
Temperature
boiling point, ° С
Methane CH 4 CH 4 Gas –161,6
Ethane C 2 H 6 CH 3 CH 3 Gas –88,6
Propane C 3 H 8 CH 3 CH 2 CH 3 Gas –42,1
Butane C 4 H 10 CH 3 CH 2 CH 2 CH 3 Gas –0,5
Pentane C 5 H 12 CH 3 (CH 2) 3 CH 3 Liquid 36,1
Hexane C 6 H 14 CH 3 (CH 2) 4 CH 3 Liquid 68,7
Heptane C 7 H 16 CH 3 (CH 2) 5 CH 3 Liquid 98,5
Octane C 8 H 18 CH 3 (CH 2) 6 CH 3 Liquid 125,6
Nonan C 9 H 20 CH 3 (CH 2) 7 CH 3 Liquid 150,7
Dean S 10 N 22 CH 3 (CH 2) 8 CH 3 Liquid 174,0

Composing the names of branched and substituted alkanes

1. The main carbon chain is selected and numbered in such a way (left or right) so that the incoming substituents are given the lowest numbers.

2. The name begins with a digital locant - the number of the carbon at which the substituent is located. After the number, the name of the deputy is written through a dash. Different substituents are indicated sequentially. If the same substituents are repeated twice, then the prefix "di" is written in the name after the digital locants indicating the position of these substituents. Accordingly, with three identical substituents, the prefix "three", with four - "tetra", with five substituents - "penta", etc.

Deputy names

3. Together with a prefix and a substituent, they write the name of the hydrocarbon, numbered as the main carbon chain:

a) 2-methylbutane; b) 2,3-dimethylpentane; c) 2-chloro-4-methylpentane.

The names of cycloalkanes are similar, only to the name of the hydrocarbon - according to the number of carbon atoms in the cycle - add the prefix "cyclo":

Substances that are similar in structure, but differ by one or several groups - CH 2 -, are known as g ……. ...
Examples of homologues:

CH 3 –CH 3, CH 3 –CH 2 –CH 3, CH 3 –CH 2 –CH 2 –CH 3.

Similarity - alkanes with linear chain:

The similarity of the three formulas of the substances of the last example - in each case, at the second C atom of the main carbon chain, there is the same substituent - the CH 3 group.

Exercises.

1. Indicate the classes to which the following compounds may belong (underline alkanes with one line, cycloalkanes with two):

C 5 H 8, C 4 H 8, C 4 H 10, C 5 H 12, C 3 H 4, C 3 H 8, C 4 H 6, C 6 H 12, C 7 H 16, C 6 H 6.

2. Draw up the structural formulas of hydrocarbons containing seven C atoms in a molecule:
a) linear structure; b) with a branched chain; c) with a chain including a cycle.

3. Select homologues from the following substances (isolate in the same way). Explain how they are similar and different:

CH 3 Cl, CH 3 CH 2 CH 3, CH 3 CH 2 CH 2 CH 3,

4. Make structural formulas: a) a higher homologue(+ CH 2); b) lower homologue - for the following substances:

5. Select the main chains of carbon atoms, number them and relate the names (given below) to the structure of the following compounds:

a) 1-Bromo-2-methylcyclopropane; b) 1-bromo-3-methylbutane; at) n-octane; d) 2-bromobutane.

6. Name the compounds by their structural formulas: similarity - both substances contain

three-carbon ring, and differ in two CH 2 groups.

Cyclic structures

Loop constructs provide multiple execution of the same sequence of instructions, which is called the body of the loop. There are two types of elementary cyclic structures:

 cycles with a parameter;

 iterative or conditional loops.

Loops with a parameter are used when the number of repetitions of the loop body is known in advance. In Pascal, parameter loops are implemented using the For statement.

Iterative loops are used when the number of repetitions is not known in advance, but the loop termination condition is specified. Moreover, if the loop termination condition is checked before executing the loop body, then such cyclic structures are called iterative loops with a precondition (“Execute while”), and if the condition is checked after the loop body is executed, they are called iterative loops with a postcondition (“Execute until ”).

In practice, conditional loops are most often used in two cases:

    The number of repetitions is not known in advance (for example, the cycle until the required accuracy of the result is achieved).

    The number of repetitions is known in advance, but the step of the loop parameter is not equal to 1 (or –1).

In Pascal, preconditioned iteration loops are implemented using the While statement, and postconditioned iterative loops using the Repeat… Until operator.

OperatorFOR

Loop with parameter (counter)

For statement syntax:

Operator format:

for (parameter): \u003d (start value) to / downto (end value) do (operator);

Parameter values \u200b\u200bcan only be of ordinal type, and the step of changing the parameter can only be +1 (to) or -1 (downto). The loop is executed as long as the loop parameter is less than or equal to the final value.

Examples of:

    Tabulate the function (find the values \u200b\u200bof the function) y \u003d sin x on a segment with a step h.

The program that implements this algorithm looks like:

The program that implements this algorithm will look like:

Loop with While Precondition

The precondition loop is executed as long as the condition is true. With a precondition, because the condition comes before the body of the loop.

Operator format:

while (condition) do (operator);

This operator works as follows: before entering the loop itself, the condition is checked. If it is executed, then the program enters the body of the loop, if the condition is not met, then the program moves on to the next statement after the loop. The condition is checked after each iteration. It may also happen that the program does not get into the body of the loop even once.

Loop with postcondition

It happens that you need to get the results of the first iteration of the loop, and only then check the condition. In this case, you can use the repeat… until operator.

The repeat statement is provided until the condition is met. Operator format:

(operators)

until (condition);

Example... Calculate the sum of an infinite series with a given precision Eps, (i.e., calculate the sum of all the members of the sequence not less than a given number of Eps).

Component Memo (multi-line editing window). Used to enter, display and edit multi-line texts. Belongs to the Standard group.

Sets the alignment mode for text inside a Memo.

Specifies whether the component should be resized when the font size changes.

Sets the frame style for the Memo.

Specifies the color in which the Memo element is displayed on the screen.

Defines the text that will be displayed line by line in the Memo window when the program starts. The text is set in the String List Editor window

Allows you to limit the number of characters entered by the user.

Specifies the presence of scroll bars.

Used to get the text of a Memo component as a single line. The value of this property is not displayed in the Object Inspector and can only be accessed at runtime.

Example of use in the program

1. Filling the Memo using the Text property using the example of a tabulation function.

2. Same example, but Memo is populated using the Lines property. The Add method applied to Lines allows you to add a line to the Memo. Statement memo1.Lines: \u003d ’x | y '; sets the first line in a Memo.

Button operation

Delphi provides a large selection of buttons (Button, BitBtn, SpeedButton, MainMenu), but working with all these components has a lot in common: buttons are used to enter some information and go to further action programs. Buttons have a caption (the Caption property) and an onClick method. BitBtn differs from Button in that the first has a Glyph property, into which you can upload a picture (the final path is always the same: Program Files \\ Common Files \\ Borland Shared \\ Images \\ Buttons). Also, the BitBtn component has a Kind property, which can take the following values, shown in the figure. The corresponding picture will appear on the button. If the value of the Kind property is set to bkClose for a button, then when this button is pressed, the current window will be closed. A more detailed explanation of the use of this property will be discussed below (working with a form).

Kind property values

When the user selects a component with the mouse, its cursor can take on different views (hourglass, hand, etc.) if the programmer has configured the Cursor property. You can also customize the tooltip (text is highlighted in a rectangle next to the component when you hover over it with the mouse). To do this, select the Hint property, into which we print the required text, set the ShowHint property of the Boolean type to True.

Cursor property value

Hint and ShowHint property value

Component Image (graphic image). Allows you to display a picture loaded from a graphic file. Refers to the Additional group.

Recurrent formula

Any formula that expresses each member of a sequence through the previous members of this sequence is called recurrent. It is used most often to get rid of large numbers when calculating the sum of the members of a sequence.

As a rule, in this case, the recurrent formula has the form:, whence, knowing the common term of the sequence, it will be possible to find the coefficient C , by which you need to multiply each previous term in the sequence to find the next one:

Example... Calculate the sum of an infinite series:

Let's find the coefficient C by dividing the (k + 1) -th term by the k-th:

Thus, the next member of the series can be calculated using the recurrent formula:

Subroutines

A subroutine is a group of statements that are logically completed and designed in a special way. The subroutine can be called an unlimited number of times from anywhere in the program. Using subroutines allows you to structure the program, reduce its size, and increase readability.

The structure of the subroutine is similar to the structure of the program. It also contains a title that differs in design from the title of the program, and a block for describing variables, but there is no block for connecting modules.

Working with any subroutine includes two stages: the description of the subroutine and its call.

Subroutines are divided into two types: functions and procedures, which differ in that a function can, under its own name, return a value as a result.

Procedures

When describing a procedure, a heading is specified, which consists of the required word Procedure, the name of the procedure, and an optional list of parameters in parentheses indicating the type of each parameter). A procedure is called using a call statement, which consists of the procedure name and a list of arguments enclosed in parentheses. Arguments must be specified in the exact order and with the same data types as in the description of the procedure.

Procedure structure

Procedure (formal parameter list) ;

Begin

The list of formal parameters may include:

Parameters-values \u200b\u200bor input parameters, the values \u200b\u200bof which must be set before starting this procedure (determine the initial data for the procedure to work);

Parameters-variables or output parameters that receive their specific value as a result of the procedure (determine the output of the procedure). Before the enumeration of variable parameters in the list of formal parameters there must be keyword var.

Each parameter has a name and type indicated by ":". Parameters are separated from each other by ";"

Referring to the procedure is carried out in the main program by specifying its name and a list of actual parameters of the same type and quantity as the formal ones.

Functions

Functions consist of a header and a block. The header contains the function keyword, the function name, an optional formal parameter list enclosed in parentheses, and the type of the function's return value. The return value can be of any type other than file type.

A function block is similar to a procedure block. The body of the function requires at least one assignment operator, on the left side of which is the function name (it is better to use the Result variable instead of the function name).

A function is called by its name with a list of arguments in parentheses, which may not exist. If there are arguments, they must be specified in the exact same order and have the same type as the function header block.

Parameters and arguments

Parameters are elements of a subroutine and are used to describe its algorithm. Arguments are specified when the subroutine is called and override parameters when the subroutine is executed. Parameters can be of any type, including structured. There are the following types of parameters:

    Value

    Constant

    Variable

    Untyped constant and variable

A group of parameters preceded by the words var or const in the subroutine header and followed by an indication of their type are called value parameters... In the subroutine, the values \u200b\u200bof such parameters can be changed, but these changes do not affect the value of the corresponding arguments, which were substituted for the actual parameter values.

Recursion

The word "recursion" comes from the Latin word "recursio" - return.

If a procedure (or function) refers to itself as a procedure (or function) directly or through a chain of subroutines, this is called recursion.

In order for this type of program not to get stuck in an endless loop (which is very real), first of all, it is necessary to provide an exit from the recursion.

Cyclic structures in the language ...

  • Development of algorithms for various structures and their implementation using software

    Coursework \u003e\u003e Computer Science

    Algorithmic constructions: linear (sequential), branching and cyclical... Linear algorithmic construction Linear accepted ... to be terminated. When developing an algorithm cyclical structures the following concepts are distinguished: cycle parameter ...

  • Features of the formation of polyconjugate structures in the process of thermal and oxidative destruction of polyacrylonitrile

    Article \u003e\u003e Chemistry

    It is to nitrogen, which is in the composition of intermediate cyclical structures, are the kinetic curves of changes in elemental ... the addition of oxygen to the polymer is oxidation cyclical structures to N-oxides. REFERENCES Huron J. L., Meybek ...

  • Structure and the principle of operation of the device for controlling the span by the method of axle count

    Abstract \u003e\u003e Transport

    Structure and the principle of operation of the control device ... counting points are transmitted to the deciding device cyclically using an anti-jamming code; in the system ... and SP2 is transmitted to the PSA continuously, cyclical way. The PSA operates in a constant ...

  • Cyclic compounds are divided into carbocyclic and heterocyclic compounds.

    Carbocyclic compounds contain only carbon atoms in their rings, while the rings of heterocyclic compounds contain atoms of other elements (oxygen, nitrogen, sulfur, etc.).

    Carbocyclic compounds are classified into alicyclic and aromatic compounds.

    Alicyclic compounds

    Alicyclic compounds are compounds whose molecules contain one or more non-aromatic rings.

    The term "alicyclic" means aliphatic cyclic compounds, since in their properties they are similar to the corresponding compounds of the aliphatic series.

    However, despite the great similarity between aliphatic and alicyclic compounds, there are some features in the behavior of the latter, which is due to the presence of a cyclic structure in them.

    Classification of alicyclic compounds

    Alicyclic compounds are subdivided depending on on the size of the cycle, the number of cycles and the method of connecting the cycles.

    The simplest alicyclic cycle is three-membered. But alicycles with the number of carbon atoms up to 30 and more are known.

    Alicyclic compounds containing two, three, four or more cycles in a molecule connected in different ways are called polyalicyclic compounds.

    Depending on how the rings are joined, they can have one, two, three or more carbon atoms in common.

    In accordance with this, bicyclic compounds are classified:

      spirans have one carbon atom common to two cycles;

      in connections condensed cycle common for the two cycles are two adjacent carbon atoms;

      if there are more than two total carbon atoms, then alicycles are called bridge .

    By the nature of the bonds in the cycles, there are:

      saturated alicyclic compounds (cycloalkanes);

      unsaturated alicyclic compounds with one double bond (cycloalkenes), with two - cycloalkadienes, with three - cycloalkatrienes, with one triple bond - cycloalkynes.

    Cycloalkanes (cycloparaffins)

    Cycloalkanes are called saturated alicyclic hydrocarbons, in the molecules of which all carbon atoms of the cycle are interconnected by simple single ϭ - bonds.

    In their properties, they resemble the usual saturated hydrocarbons - alkanes (paraffins), hence their name - cycloalkanes (cycloparaffins).

    Cycloalkanes are sometimes called polymethylene hydrocarbons (i.e., consisting of methylene groups CH 2 linked together in a ring), or naphthenes, since some cycloalkanes (cyclopentanes, cyclohexanes and their derivatives) are found in some types of oil (for example, Caucasian or Californian).

    The composition of cycloalkanes is expressed by the general formula C n H 2 n, i.e. they are isomeric to ethylene hydrocarbons (alkenes).