Dependence of the equilibrium constant. Chemical equilibrium shift

Chemical equilibrium is a state of reversible chemical reaction.

aA+ b B= c C+ d D,

in which there is no change in the concentrations of reactants in the reaction mixture over time. The state of chemical equilibrium is characterized chemical equilibrium constant:

Where C i– concentration of components in equilibrium perfect mixture.

The equilibrium constant can also be expressed in terms of equilibrium mole fractions X i components:

For reactions occurring in the gas phase, it is convenient to express the equilibrium constant in terms of equilibrium partial pressures P i components:

For ideal gases P i = C i RT And P i = X i P, Where P is the total pressure, therefore K P, K C And K X are related by the following relationship:

K P = K C (RT) c+d–a–b = K X P c+d–a–b. (9.4)

The equilibrium constant is related to rG o chemical reaction:

(9.5)

(9.6)

Change rG or r F in a chemical reaction at given (not necessarily equilibrium) partial pressures P i or concentrations C i components can be calculated using the equation chemical reaction isotherms (van't Hoff isotherms):

. (9.7)

. (9.8)

According to Le Chatelier's principle, if an external influence is exerted on a system that is in equilibrium, then the equilibrium will shift so as to reduce the effect of the external influence. Thus, an increase in pressure shifts the equilibrium towards a decrease in the number of gas molecules. Adding any reaction component to an equilibrium mixture shifts the equilibrium towards a decrease in the amount of this component. An increase (or decrease) in temperature shifts the equilibrium towards a reaction that occurs with the absorption (release) of heat.

The quantitative dependence of the equilibrium constant on temperature is described by the equation chemical reaction isobars (van't Hoff isobars)

(9.9)

And isochores of a chemical reaction (van't Hoff isochores)

. (9.10)

Integrating equation (9.9) under the assumption that r H reaction does not depend on temperature (which is true in narrow temperature ranges), gives:

(9.11)

(9.12)

Where C – integration constant. Thus, the dependence ln K P from 1 /T must be linear, and the slope of the straight line is – r H/R.

Integration within K 1 , K 2 , and T 1, T 2 gives:

(9.13)

(9.14)

Using this equation, knowing the equilibrium constants at two different temperatures, we can calculate r H reactions. Accordingly, knowing r H reactions and the equilibrium constant at one temperature, you can calculate the equilibrium constant at another temperature.

EXAMPLES

CO(g) + 2H 2 (g) = CH 3 OH(g)

at 500 K. f G o for CO(g) and CH 3 OH(g) at 500 K are equal to –155.41 kJ. mol –1 and –134.20 kJ. mol –1 respectively.

Solution. G o reactions:

r G o= f G o(CH 3 OH) – f G o(CO) = –134.20 – (–155.41) = 21.21 kJ. mol –1 .

= 6.09 10 –3 .

Example 9-2. Reaction equilibrium constant

equal to K P = 1.64 10 –4 at 400 o C. What total pressure must be applied to an equimolar mixture of N 2 and H 2 so that 10% of N 2 turns into NH 3? Gases are considered ideal.

Solution. Let a mole of N 2 react. Then

N 2 (g) + 3H 2 (g) = 2NH 3 (g)
Original quantity 1 1
Equilibrium quantity 1– 1–3 2 (Total: 2–2)
Equilibrium mole fraction:

Hence, K X = And K P = K X . P –2 = .

Substituting = 0.1 into the resulting formula, we have

1.64 10 –4 =, where P= 51.2 atm.

Example 9-3. Reaction equilibrium constant

CO(g) + 2H 2 (g) = CH 3 OH(g)

at 500 K is equal to K P = 6.09 10 –3 . A reaction mixture consisting of 1 mol CO, 2 mol H 2 and 1 mol of inert gas (N 2) is heated to 500 K and a total pressure of 100 atm. Calculate the composition of the equilibrium mixture.

Solution. Let a mole of CO react. Then

CO(g) + 2H 2 (g) = CH3OH(g)
Original quantity: 1 2 0
Equilibrium quantity: 1– 2–2
Total in equilibrium mixture: 3–2 mol components + 1 mol N 2 = 4–2 mol
Equilibrium mole fraction

Hence, K X = And K P = K X . P–2 = .

Thus, 6.09 10 –3 = .

Solving this equation, we get = 0.732. Accordingly, the mole fractions of substances in the equilibrium mixture are equal to: = 0.288, = 0.106, = 0.212 and = 0.394.

Example 9-4. For reaction

N 2 (g) + 3H 2 (g) = 2NH 3 (g)

at 298 K K P = 6.0 10 5 , a f H o(NH 3) = –46.1 kJ. mol –1 . Estimate the value of the equilibrium constant at 500 K.

Solution. The standard molar enthalpy of the reaction is

r H o= 2f H o(NH 3) = –92.2 kJ. mol –1 .

According to equation (9.14), =

Ln (6.0 10 5) + = –1.73, from where K 2 = 0.18.

Note that the equilibrium constant of an exothermic reaction decreases with increasing temperature, which corresponds to Le Chatelier's principle.

TASKS

  1. At 1273 K and a total pressure of 30 atm in an equilibrium mixture
  2. CO 2 (g) + C(tv) = 2CO(g)

    contains 17% (by volume) CO 2 . What percentage of CO 2 will be contained in the gas at a total pressure of 20 atm? At what pressure will the gas contain 25% CO 2?

  3. At 2000 o C and a total pressure of 1 atm, 2% of water is dissociated into hydrogen and oxygen. Calculate the equilibrium constant of the reaction
  4. H 2 O (g) = H 2 (g) + 1/2O 2 (g) under these conditions.

  5. Reaction equilibrium constant
  6. CO(g) + H 2 O(g) = CO 2 (g) + H 2 (g)

    at 500 o C is equal K p= 5.5. A mixture consisting of 1 mol CO and 5 mol H 2 O was heated to this temperature. Calculate the mole fraction of H 2 O in the equilibrium mixture.

  7. Reaction equilibrium constant
  8. N 2 O 4 (g) = 2NO 2 (g)

    at 25 o C is equal K p= 0.143. Calculate the pressure that will be established in a vessel with a volume of 1 liter, into which 1 g of N 2 O 4 was placed at this temperature.

  9. A 3-liter vessel containing 1.79 10 –2 mol I 2 was heated to 973 K. The pressure in the vessel at equilibrium turned out to be 0.49 atm. Assuming gases to be ideal, calculate the equilibrium constant at 973 K for the reaction
  10. I 2 (g) = 2I (g).

  11. For reaction
  12. at 250 o C rG o = –2508 J mol –1. At what total pressure will the degree of conversion of PCl 5 to PCl 3 and Cl 2 at 250 o C be 30%?

  13. For reaction
  14. 2HI(g) = H 2 (g) + I 2 (g)

    equilibrium constant K P = 1.83 10 –2 at 698.6 K. How many grams of HI are formed when 10 g of I 2 and 0.2 g of H 2 are heated to this temperature in a three-liter vessel? What are the partial pressures of H 2, I 2 and HI?

  15. A 1-liter vessel containing 0.341 mol PCl 5 and 0.233 mol N 2 was heated to 250 o C. The total pressure in the vessel at equilibrium turned out to be 29.33 atm. Assuming all gases are ideal, calculate the equilibrium constant at 250 o C for the reaction occurring in the vessel
  16. PCl 5 (g) = PCl 3 (g) + Cl 2 (g)

  17. Reaction equilibrium constant
  18. CO(g) + 2H 2 (g) = CH 3 OH(g)

    at 500 K is equal to K P = 6.09 10 –3 . Calculate the total pressure required to produce methanol in 90% yield if CO and H2 are taken in a 1:2 ratio.

  19. At 25 o C f G o(NH 3) = –16.5 kJ. mol –1 . rG Calculate
  20. reactions of formation of NH 3 at partial pressures of N 2, H 2 and NH 3 equal to 3 atm, 1 atm and 4 atm, respectively. In which direction will the reaction proceed spontaneously under these conditions?
  21. CO(g) + 2H 2 (g) = CH 3 OH(g)

    Exothermic reaction T is in equilibrium at 500 K and 10 bar. If the gases are ideal, how will the following factors affect the yield of methanol: a) increase P; b) promotion ; c) adding inert gas at V P= const; P d) adding inert gas at

  22. = const; e) adding H 2 at
  23. = const?
  24. The equilibrium constant of the gas-phase reaction of isomerization of borneol (C 10 H 17 OH) to isoborneol is 0.106 at 503 K. A mixture of 7.5 g of borneol and 14.0 g of isoborneol was placed in a 5-liter vessel and kept at 503 K until equilibrium was achieved.

    Calculate the mole fractions and masses of borneol and isoborneol in the equilibrium mixture. r G o Equilibrium in reaction

  25. Calculate the total pressure that must be applied to a mixture of 3 parts H 2 and 1 part N 2 to obtain an equilibrium mixture containing 10% NH 3 by volume at 400 o C. Equilibrium constant for the reaction
  26. N 2 (g) + 3H 2 (g) = 2NH 3 (g)

    at 400 o C is equal K = 1.60 10 –4 .

  27. At 250 o C and a total pressure of 1 atm, PCl 5 is dissociated by 80% by the reaction
  28. PCl 5 (g) = PCl 3 (g) + Cl 2 (g).

    What will be the degree of dissociation of PCl 5 if N 2 is added to the system so that the partial pressure of nitrogen is 0.9 atm?

  29. The total pressure is maintained at 1 atm.
  30. At 2000 o C for reaction

    N 2 (g) + O 2 (g) = 2NO (g)

  31. K p = 2.5 10 –3 .
    An equilibrium mixture of N 2, O 2, NO and inert gas at a total pressure of 1 bar contains 80% (by volume) N 2 and 16% O 2.
  32. What percentage by volume is NO? What is the partial pressure of an inert gas?

Calculate the standard enthalpy of the reaction for which the equilibrium constant is K = –1.04 –1088 /T +1.51 10 5 /T 2 .

a) increases by 2 times, b) decreases by 2 times when the temperature changes from 298 K to 308 K.

The dependence of the equilibrium constant of the reaction 2C 3 H 6 (g) = C 2 H 4 (g) + C 4 H 8 (g) on ​​temperature between 300 K and 600 K is described by the equation

ln

Equations of isobars, isochores, Van't Hoff reactions and Planck's equation

Almost always there is a need to move from one reaction conditions to others. To do this, you need to know the dependence of the equilibrium constants on temperature and pressure. Knowledge of equilibrium constants at various temperatures and pressures expands the capabilities of the chemical technologist in predicting the results of the process.

The dependence of the equilibrium constant on temperature is obtained by differentiating the reaction isotherm with respect to temperature under the condition that pressures in kp are independent of temperature

We get the expression

dividing all terms of this equation by T, we express the term through d∆G/dT. Let's substitute it into the differentiated expression of the isotherm

The resulting equation is called the Van't Hoff reaction isobar. A completely identical approach is used to derive the isochore of a reaction, in which the change in Helmholtz energy is used, and the composition of the system is expressed in terms of concentrations. The isochore expression has the form

Note that d ln k р /d P = 0 by condition; d ln P/d P = 1/P from where we get d ln to N /d P = - ∆n/P; We find Δn from the Clapeyron-Mendeleev equation, writing it for two states in the form PΔV = ΔnRT. Let us express ΔV from here and substitute it into the differentiated expression of the equilibrium constant
k n , we obtain Planck’s equation, expressing the dependence of the equilibrium constant on pressure

The isochore equations, reaction isobars and Planck’s equation have predictive value and are of significant interest to technologists. These equations are a quantitative characteristic of Le Chatelier's equilibrium shift principle. This principle can be formulated as follows: “If a system in equilibrium is influenced from the outside, changing any of the conditions that determine the equilibrium position, then a direction will strengthen in the system, the result of which will weaken the external influence, and the equilibrium position will shift in the same direction.” Most often, the conditions that determine the equilibrium position are temperature, pressure, and concentration.



Let us illustrate the predictive significance of the derived equations as a quantitative characteristic of the principle of equilibrium shift using the example of ammonia synthesis: N 2 + 3H 2 ↔ 2NH 3 - ∆H

Let us write the isobar equation

Let us assume that this system is heated ΔH<0. Правая часть урав­нения изотермы уменьшится (∆Н/RT 2)<0, значит левая часть тоже уменьшится: (d ln к р /d P)<0 (она может уменьшиться за счет уменьшения к р).

The equilibrium constant for ammonia synthesis has the form She

can decrease due to a decrease in the pressure of the reaction products and an increase in the pressure of the starting substances. This means that when heated, this exothermic reaction shifts towards the endothermic process of ammonia decomposition. This result was obtained based on the analysis of the Van't Hoff isobar. It is easy to show that it agrees with the prediction of Le Chatelier's principle. A similar result can be obtained by applying Planck’s equations to the analysis of this reaction, taking into account that the pressure P is the inverse of 1/V volume. Students are asked to do these actions independently.

The dependence of the reaction equilibrium constant on temperature can be described by the chemical reaction isobar equation (van't Hoff isobar):

and isochores of a chemical reaction (van't Hoff isochores):

Here Δ H and Δ U- the thermal effect of a reaction occurring, respectively, at constant pressure or constant volume. If Δ H> 0 (the thermal effect is positive, the reaction is endothermic), then the temperature coefficient is constant

equilibrium is also positive, that is, with increasing temperature, the equilibrium constant of the endothermic reaction increases, the equilibrium shifts to the right (which is quite consistent with Le Chatelier’s principle).

Equilibrium constant and reaction rate constant

For a reversible chemical reaction, the equilibrium constant can be expressed in terms of the rate constants of forward and reverse reactions, based on the fact that in equilibrium the rates of forward and reverse reactions are equal. For example, for an elementary reversible chemical reaction of the first order

it is easy to show that:

Where k 1 is the rate constant of the forward reaction, and k 2 - reverse. This important relationship provides one of the “points of contact” between chemical kinetics and chemical thermodynamics.

Methods for calculating the equilibrium constant

Calculation methods for determining the equilibrium constant of a reaction usually come down to calculating in one way or another the standard change in the Gibbs energy during the reaction ( ΔG 0 ), and then using the formula:

It should be remembered that the Gibbs energy is a function of the state of the system, that is, it does not depend on the path of the process, on the reaction mechanism, but is determined only by the initial and final states of the system. Therefore, if direct determination or calculation ΔG 0 for some reaction are difficult for some reason, you can select intermediate reactions for which ΔG 0 known or can be easily determined, and the summation of which will give the reaction in question (see Hess's Law). In particular, reactions of the formation of compounds from elements are often used as such intermediate reactions.

Entropy calculation of the change in the Gibbs energy and the equilibrium constant of the reaction

Entropy calculation method ΔG reaction is one of the most common and convenient. It is based on the relationship:

or, accordingly, for standard Gibbs energy changes:

Here ΔH 0 at constant pressure and temperature is equal to the thermal effect of the reaction, the methods of calculation and experimental determination of which are known - see, for example, the Kirchhoff equation:

It is necessary to obtain the change in entropy during the reaction. This problem can be solved in several ways, for example:

According to thermal data - based on Nernst’s thermal theorem and using information about the temperature dependence of the heat capacity of the reaction participants. For example, for substances that are in a solid state under normal conditions:

where S 0 = 0 (Planck’s postulate) and then, accordingly,

.

(here the index sol is from the English solid). At some given temperature T:

For substances that are liquid or gaseous at normal temperature, or, more generally, for substances that undergo a phase transition in the temperature range from 0 (or 298) to T, the change in entropy associated with this phase transition should be taken into account.

For ideal gases - by methods of quantum statistics.

Using various empirical and semi-empirical methods, a small amount of initial data is often sufficient for this. For example, for solid inorganic substances, entropy can be estimated using the formula

where A and B are tabular constants depending on the type of compound in question, M is the molecular weight.

So, if , and the temperature dependences of the heat capacity are known, it can be calculated using the formula:

A somewhat simplified version of this formula is obtained by considering the sum of the heat capacities of substances to be independent of temperature and equal to the sum of the heat capacities at 298 K:

And an even more simplified calculation is carried out by equating the sum of the heat capacities to zero:

The transition from to the equilibrium constant is carried out according to the above formula.

Le Chatelier-Brown principle(1884) - if a system that is in stable equilibrium is influenced from the outside, changing any of the equilibrium conditions (temperature, pressure, concentration), then the processes in the system aimed at compensating for the external influence intensify.

Henri Le Chatelier (France) formulated this thermodynamic principle of mobile equilibrium, later generalized by Karl Braun

Let us consider the general reverse reaction

Experimental studies show that in a state of equilibrium the following relationship holds:

(square brackets indicate concentration). The above relationship is a mathematical expression of the law of mass action, or the law of chemical equilibrium, according to which, in a state of chemical equilibrium at a certain temperature, the product of the concentrations of reaction products in powers, exponents

which are equal to the corresponding coefficients in the stoichiometric reaction equation, divided by a similar product of the concentrations of the reactants in the corresponding powers, represents a constant value. This constant is called the equilibrium constant. The expression of the equilibrium constant in terms of the concentrations of products and reagents is typical for reactions in solutions.

Note that the right side of the expression for the equilibrium constant contains only the concentrations of solutes. It should not include any terms related to the pure solids, pure liquids, or solvents participating in the reaction, since these terms are constant.

For reactions involving gases, the equilibrium constant is expressed in terms of the partial pressures of the gases, and not in terms of their concentrations. In this case, the equilibrium constant is denoted by the symbol.

The concentration of a gas can be expressed in terms of its pressure using the ideal gas equation of state (see Section 3.1):

From this equation it follows

where is the gas concentration, which can be denoted as [gas]. Since - is a constant value, we can write that at a given temperature

Let us express the equilibrium constant for the reaction between hydrogen and iodine in terms of the partial pressures of these gases.

The equation for this reaction has the form

Therefore, the equilibrium constant of this reaction is given by

Let us note that the concentrations or partial pressures of products, i.e., substances indicated on the right side of the chemical equation, always form the numerator, and the concentrations or partial pressures of reactants, i.e., substances indicated on the left side of the chemical equation, always form the denominator of the expression for the equilibrium constant.

Units of measurement for the equilibrium constant

The equilibrium constant can be a dimensional or dimensionless quantity, depending on the type of its mathematical expression. In the example above, the equilibrium constant is a dimensionless quantity because the numerator and denominator of the fraction have the same dimensions. Otherwise, the equilibrium constant has a dimension expressed in units of concentration or pressure.

What is the dimension of the equilibrium constant for the following reaction?

Therefore, it has a dimension (mol-dm-3)

So, the dimension of the equilibrium constant under consideration is or dm3/mol.

What is the dimension of the equilibrium constant for the following reaction?

The equilibrium constant of this reaction is determined by the expression

Therefore, it has dimension

So, the dimension of this equilibrium constant is: atm or Pa.

Heterogeneous equilibria

So far we have given examples only of homogeneous equilibria. For example, in the synthesis reaction of hydrogen iodide, both the product and both reactants are in a gaseous state.

As an example of a reaction leading to heterogeneous equilibrium, consider the thermal dissociation of calcium carbonate

The equilibrium constant of this reaction is given by

Note that this expression does not include any terms related to the two solids involved in the reaction. In the example given, the equilibrium constant represents the dissociation pressure of calcium carbonate. It shows that if calcium carbonate is heated in a closed vessel, then its dissociation pressure at a fixed temperature does not depend on the amount of calcium carbonate. In the next section, we will learn how the equilibrium constant changes with temperature. In the example under consideration, the dissociation pressure exceeds 1 atm only at a temperature higher. Therefore, in order for the dioxide

Well, we're starting to get to the point. You should already understand what a variable is and how to use conditions in your programs. I hope this is so, otherwise everything else is pointless for you to read.

When I talked about variables, I left out one more type of variable. This variable, unlike the others, stores its value throughout the execution of the program. It is initiated upon declaration and cannot be changed in further code. This variable is called constant.

What are constants for? To store permanent information. As much as I would not like to give mathematical comparisons, they are the most obvious. Remember physics - gravitational constant, temperature in Kelvin, Fahrenheit, etc. All these are constants. In fact, we once declared such a variable and forgot about its meaning, substituting its name in the program. you may ask, why can't you use a simple variable to store such information? But because you can assign a different value to this variable, but not to a constant.

Let's look at the syntax, and then I'll give a visual example.

In C, a constant was defined by the directive # define

#define PI 3.14 // PI will now contain 3.14

This directive can be found in many current programs, but it is an outdated approach. A new modifier has been introduced in C++ const.

Const float PI=3.14;\

Const float PI=3.14; int _tmain(int argc, _TCHAR* argv) ( setlocale (0,""); //set the default language (Russian) int S,R=21; //area and radius of the circle S=PI*R*R; system ("pause"); //to prevent the window from closing return 0;

Wherever we call this variable, everywhere it will be equal to 3.14. Very convenient, isn't it? By the way, for the sake of experiment, try to assign some value to PI in the program. See how the compiler reacts.

Well, in conclusion, regarding constants, I can say that you can use an arithmetic expression as a constant.

Const PROIZV=23*12; // now we have the number 276 in the constant

Also, remember one rule - Constant names should always be written in capital letters! This will make your life easier, too, since when you encounter a correctly formatted constant, you will immediately understand that it is a constant.

Along with constants, they are widely used in programming transfers. At its core, it is a set of constants. They are needed to limit the variable's range of values. This could be the day of the week, month, gender (husband or wife), etc. Enumerations are especially widely used in game writing.

Well, let's now forget about what I wrote above and look at the enumeration as an example.

Enumerations must be declared outside the main function. The point is that it is a programmer-defined type. And such types, along with structures and classes, should be declared, preferably in a separate module. But we will look at all this much later. Here's how the enumeration is declared:

enum Month (Jan, Feb, Marth,April, May, June, Jule, August, Sept, Oct, Nov, Dec);

The enumeration begins with the keyword enum, then the name of the enumeration ( this is not a variable!!!), and the set of values ​​is indicated in brackets.

Now we can use the declared type in our program:

Int main () ( Month curMonth=June; // now //July is stored in the curMonth variable)

What do you think is stored in the curMonth variable? If you think it's June, you're wrong. An enumeration is a numeric type and is implicitly cast to int. Numbering starts from 0. Knowing this, we can assume that curMonth contains the number 5. In other words, we could assign this variable, instead of the name of the month, its numeric analogue in the enumeration interpretation and we would be right.

Of course, the example with a month or day of the week is not very clear. However, you must understand that a variable can be limited to a range of values. Try it, assign curMonth a value other than an enum and see what the J compiler calls you.

But in programming, for example under Windows, we will often encounter enumerations and constants. This is where you will fully understand the convenience of using them.

Now let's go back to our example and see what else we can change. We number the months from one, not from zero. From our code you can see that June 100 is assigned the value 5, not 6. Well, you can set your own numbering in the enumeration.

I explicitly assigned Jan the value 1. The compiler itself will assign the necessary values ​​to the remaining months. Of course, you can do everything manually, but there’s no point in doing so.

And finally. A variable can also be declared when specifying an enumeration:

Enum Month (Jan=1, Feb, Marth,April, May, June, Jule, August, Sept, Oct, Nov, Dec) thisMonth;

Then this variable can already be used in the program. You can announce a lot of them there. But personally, I don’t like this method, considering it somewhat confusing. After all, we are programming not in C, but in C++.

Cast

Read here carefully. The fact is that C++ is famous for its arithmetic errors in calculations. No, he calculates everything correctly, but the result of the calculation greatly depends on the type of the variable. A programmer who decides to assign a division quotient to type int may often not get the desired result. The fact is that the language compiler performs implicit type conversions.

Here's an example. We need to calculate the employee's salary. We know the hour rate. Then we multiply this value by the number of hours worked and get the desired result. Everything is simple here. But imagine a director who hires an employee and doesn’t know how much to pay him. Then he takes the salary for the region and divides it by the number of hours.

Int zarp, hour, vel; vel=22320; // salary in the city is 22,320 rubles hour=22 * 8; //the number of hours is 22 working days * 8 hour working day zarp=vel / hour; // our hour cout<<"Час работника стоит =" <

The program will give us a figure of 126 rubles. This suits us, but it’s easy to take a calculator and calculate that in fact the number is 126.8. And if the employee is not offended by this shortcoming, then such errors are unacceptable in the calculations. What happened?

zarp is an integer and only stores the integer value. The fractional part will be discarded. In other words, it was necessary to use the double type, which would store the fraction. But here the situation is somewhat more interesting. The compiler temporarily assigns the double type to the hour and vel variables, as if expanding their meaning. We may not be aware of this, although it is important to understand. The compiler, encountering a larger type, assigns its operand to the smaller type. That's all the rule.

However, imagine a situation where a paranoid programmer wastes memory in vain (do you remember that the double type is 2 times larger than int?) and tries to assign exactly this type everywhere. Yes, it gets the exact value, sacrificing some performance (operations with fractional types are slower than with integer types, but this is no longer relevant), but you are artificially painting yourself into a corner. Let's go back to our director, who still doesn't know how much he should pay for his work. Let's say that a scrupulous accountant gave him an hourly value of 132.12 rubles. You'll immediately assign it the value double, start calculating, and howl when pennies appear everywhere. Well, we don’t need to give them to the employee!

In this case, if you made such a mistake, you can make an explicit cast. In C it was done like this:

(cast type)expression

(int)vel; // artificially converted the type to an integer.

In C++, Stroupstrup introduced a new transformation. Here is his description:

static _ cast <тип>(expression)

Transformations are considered a sign of bad programming taste. If you have too many conversions, then most likely you need to change all the values ​​in the program.

However, transformations are often used in OOP. We won’t dwell on them for now; anyway, with practice you will understand everything right away.

So go get some rest. The next lesson will be more difficult and much more important. I hasten to please you - there are a few lessons left of this foundation and we will begin normal programming.