Turbo Pascal. The athlete ran 10 km on the first day, and each day he increased the rate by 10% of the rate

Turbo Pascal. The athlete ran 10 km on the first day, and each day he increased the rate by 10% of the rate of the previous day. Determine: a) How many days will he run no more than 20 km? b) How many kilometers will he run on the 7th day?

Program Primer1;

Var
i: integer;
d, s: real;

begin
d: = 10; {1 day mileage}
s: = 10; {total mileage for 1 day}
for i: = 2 to 7 do
begin
d: = d * 1.1; {mileage for each next day}
s: = s + d; {mileage amount}
end;
writeln (‘for 7 days-‘, s); {7 day run}
end.

For 2 days, the athlete runs 11 km, so he will run no more than 20 km in 1 day.

For 30 km or more, you can insert a line into the loop

if s <30 then writeln (‘for’, i, ‘day’);



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.