if not hasBadThings then begin if (days > 45) and (stazh > 5) then prem := oklad * 20 / 100 else if (days > 35) and (days < 45) and (stazh > 5) then prem := oklad * 15 / 100 else if (days < 25) and (stazh > 5) then prem := oklad * 7 / 100 else if (days < 25) and (stazh < 5) then prem := oklad * 5 / 100 else if (days < 35) and (stazh > 5) then prem := oklad * 10 / 100 end;
writeln('Премия сотрудника: ', trunc(prem)); end;
var days, stazh : integer; hasBadThings :boolean; begin write('Стаж: '); readln(stazh); write('Замечания (True/False): '); readln(hasBadThings); write('Отработанные дни: '); readln(days);
Answers & Comments
var
prem : real;
begin
prem := 0;
if not hasBadThings then
begin
if (days > 45) and (stazh > 5) then
prem := oklad * 20 / 100
else if (days > 35) and (days < 45) and (stazh > 5) then
prem := oklad * 15 / 100
else if (days < 25) and (stazh > 5) then
prem := oklad * 7 / 100
else if (days < 25) and (stazh < 5) then
prem := oklad * 5 / 100
else if (days < 35) and (stazh > 5) then
prem := oklad * 10 / 100 end;
writeln('Премия сотрудника: ', trunc(prem));
end;
var
days, stazh : integer;
hasBadThings :boolean;
begin
write('Стаж: ');
readln(stazh);
write('Замечания (True/False): ');
readln(hasBadThings);
write('Отработанные дни: ');
readln(days);
premia(days, hasBadThings, stazh, random(20000) + 20000);
end.