Home computickets After 39 lines, commands are not executed, why? How to fix it?

After 39 lines, commands are not executed, why? How to fix it?

Author

Date

Category

Task;

In the aerobus, which accommodates 160 passengers, three quarters of the places are located in the economy class salon and one quarter of the places – in the business class cabin.
The cost of a ticket in the business class cabin is x rubles, which is two times higher than the cost of the ticket in the economy class.

Purpose:

It is necessary to calculate the amount of money received by the airline from the sale of tickets for one flight, if it is known that there are unreasonable A business class tickets and b tickets of the economic class.
Fix your actions on each of the task solutions.

Program Air_1;
 VAR A, B, C, D, E, F, G, X, Y, K, L, V: REAL;
 // A - not sold out business class tickets.
 // B - not sold out economy class tickets.
 // C - the number of places in the business class.
 // D - the number of places in the economy class.
 // E - business class ticket.
 // F - the cost of the ticket in the economy class.
 // G - the total number of places in the aircraft.
 // X - the number of places sold in business class.
 // Y - the number of seats sold in economy class.
 // k - earned money for the business class.
 // L - earned money for economy class.
 // V - the total affair airline for this flight.
Begin.
 Write ('Enter the number of places in the aircraft');
 readln (g);
 C: = G / 4 * 3;
 D: = G / 4 * 1;
 Writeln ('C =', C);
 Writeln ('D =', D);
 Writeln ('Enter the cost of the business class');
 READLN (E);
 F: = E / 2;
 Writeln ('E =', E);
 Writeln ('F =', F);
 writeln ('how many seats are not sold in business class');
 readln (x);
 x: = C-A;
 writeln ('how many seats are not sold in economy class');
 readln (y);
 y: = d-b;
 k: = x * e;
 readln (k);
 L: = y * f;
 READLN (L);
 Writeln ('The company earned on business class', k, 'rubles.');
 Writeln ('The company earned on the economy class', l, 'rubles.');
 V: = k + l;
 READLN (V);
 Writeln ('Airlines received for this flight', V, 'rubles.');
end.

Answer 1, Authority 100%

You have two extra efflores:

readln (k)

and

readln (L)

code should look like this:

Program Air_1;
 VAR A, B, C, D, E, F, G, X, Y, K, L, V: REAL;
Begin.
 Write ('Enter the number of places in the aircraft');
 readln (g);
 C: = G / 4 * 3;
 D: = G / 4 * 1;
 Writeln ('C =', C);
 Writeln ('D =', D);
 Writeln ('Enter the cost of the business class');
 READLN (E);
 F: = E / 2;
 Writeln ('E =', E);
 Writeln ('F =', F);
 writeln ('how many seats are not sold in business class');
 readln (x);
 x: = C-A;
 writeln ('how many seats are not sold in economy class');
 readln (y);
 y: = d-b;
 k: = x * e;
 L: = y * f;
 Writeln ('The company earned on business class', k, 'rubles.');
 Writeln ('The company earned on the economy class', l, 'rubles.');
 V: = k + l;
 READLN (V);
 Writeln ('Airlines received for this flight', V, 'rubles.');
end.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions