procedure Delete; begin
clrscr;
reset(f);
while not (eof(f)) do begin
read(f, z); write(z.fam);
gotoxy(15,wherey); write(z.im); gotoxy(27,wherey); write(z.otch); gotoxy(44,wherey); write(z.tseh); gotoxy(49,wherey); write(z.pol); gotoxy(54,wherey); write(z.vozrast); gotoxy(59,wherey); write(z.zarpl:5:2); writeln;
end;
close(f);
writeln;
reset(f);
writeln('Zadajte nomer udaljaemoj zapisi'); readln(n); if n>filesize(f) then write('Takoj zapisi net')
else begin
assign(f1,'rabota2.dat'); reset(f); rewrite(f1);
for i:=1 to filesize(f) do begin
read(f, z);
if filepos(f)<>n then write (f1,z); end;
close(f1); close(f);
erase(f); rename (f1,'rabota.dat'); write('Zapis udalena');
end;
readkey;
end;
procedure Redakt; begin
clrscr;
reset(f);
while not (eof(f)) do begin
read(f, z); write(z.fam);
gotoxy(15,wherey); write(z.im); gotoxy(27,wherey); write(z.otch); gotoxy(44,wherey); write(z.tseh); gotoxy(49,wherey); write(z.pol); gotoxy(54,wherey); write(z.vozrast); gotoxy(59,wherey); write(z.zarpl:5:2); writeln;
end;
СумДУ МК І КР 0023
Змн. Арк. № докум. Підпис Дата
Арк.
21
close(f); |
|
|
|
reset(f); |
|
|
|
writeln('Vvedite nomer zapisi'); readln(n); |
|
||
if n>filesize(f) then write('Takoj zapisi net') |
|
||
else |
|
|
|
begin |
|
|
|
seek(f,n-1); |
|
|
|
writeln('Vvedite dannye ',n, ' rabotnika'); |
|
||
writeln('Vvedite familiju: '); |
readln(z.fam); |
|
|
writeln('Vvedite imja : '); |
readln(z.im); |
|
|
writeln('Vvedite otchestvo : '); |
readln(z.otch); |
|
|
writeln('Vvedite nomer tseha: '); readln(z.tseh); |
|
||
writeln('Vvedite pol: '); |
readln(z.pol); |
|
|
writeln('Vvedite vozrast: '); |
readln(z.vozrast); |
|
|
writeln('Vvedite zarplatu: '); |
readln(z.zarpl); |
|
|
write(f, z); |
|
|
|
write('Zapis izmenena'); |
|
|
|
end; |
|
|
|
readkey; |
|
|
|
close(f); |
|
|
|
end; |
|
|
|
procedure Poisk; |
|
|
|
begin |
|
|
|
clrscr; |
|
|
|
write('Vvedite nomer tsheha: '); readln(n_tseh); |
|
||
s:=0; k:=0; max:=0; |
|
|
|
reset(f); |
|
|
|
writeln; |
|
|
|
while not (eof(f)) do |
|
|
|
begin |
|
|
|
read(f, z); |
|
|
|
if n_tseh=z.tseh then k:=k+1 |
|
|
|
end; |
|
|
|
close(f); |
|
|
|
reset(f); |
|
|
|
if k=0 then write('Takogo tseha net') |
|
|
|
else |
|
|
|
begin |
|
|
|
writeln('Spisok rabotnikov ', n_tseh, ' tseha'); |
|
||
while not (eof(f)) do |
|
|
|
begin |
|
|
|
read(f, z); |
|
|
|
if n_tseh=z.tseh then |
|
|
|
|
begin |
|
|
|
write(z.fam); |
|
|
|
gotoxy(15,wherey); write(z.im); |
|
|
|
gotoxy(27,wherey); write(z.otch); |
|
|
|
gotoxy(44,wherey); write(z.tseh); |
|
|
|
gotoxy(49,wherey); write(z.pol); |
|
|
|
gotoxy(54,wherey); write(z.vozrast); |
|
|
|
gotoxy(59,wherey); write(z.zarpl:5:2); |
|
|
|
writeln; |
|
|
|
СумДУ МК І КР 0023 |
Арк. |
|
|
22 |
||
Змн. Арк. № докум. |
Підпис Дата |
|
|
|
|
||
s:=s+z.zarpl;
end;
if (n_tseh=z.tseh) and (max<z.zarpl) then
begin max:=z.zarpl; z_max:=z;
end;
end;
s:=s/k;
writeln;
writeln('Srednja sarplata ',s:4:2); writeln('Maksimalnaja sarplata ',max:4:2); write(z_max.fam);
gotoxy(15,wherey); write(z_max.im); gotoxy(27,wherey); write(z_max.otch); gotoxy(44,wherey); write(z_max.tseh); gotoxy(49,wherey); write(z_max.pol); gotoxy(54,wherey); write(z_max.vozrast); gotoxy(59,wherey); write(z_max.zarpl:5:2); writeln;
end;
readkey;
end;
end.
Арк.
|
СумДУ МК І КР 0023 |
|
|
Змн. Арк. № докум. Підпис Дата |
23 |
||
|
|||
|
|