Материал: Voloxa

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

write(f,z);

write('Zapis` izmenena');

end;

readkey;

close(f);

end;

procedure Vidm;

begin

clrscr;

reset (f);

textcolor(yellow);

writeln(' Stipendiya ');

textcolor(13);

gotoxy(1,2); writeln('#');

gotoxy(4,2); writeln('Grypa');

gotoxy(12,2); writeln('Familiya');

gotoxy(24,2); writeln('Mat');

gotoxy(28,2); writeln('Ukr');

gotoxy(32,2); writeln('Inf');

gotoxy(36,2); writeln('Diyal`nist`');

gotoxy(50,2); writeln('stipendiya');

n:=1;

for i:=1 to filesize(f) do

begin

read(f,z);

if (z.mat=5) and (z.ukr=5) and (z.inf=5) and (z.gd=0) then

begin

textcolor(2);

gotoxy(1,wherey); write(n);

gotoxy(4,wherey); write(z.nomgr);

gotoxy(12,wherey); write(z.prizv);

gotoxy(24,wherey); write(z.mat);

gotoxy(28,wherey); write(z.ukr);

gotoxy(32,wherey); write(z.inf);

gotoxy(36,wherey);

if z.gd=1 then write('y4astvyet') else write('ne y4astvyet');

gotoxy(50,wherey);

if (z.mat=5) and (z.ukr=5) and (z.inf=5) and ( z.gd=1) then write('+50%')

else

if (z.mat=5) and (z.ukr=5) and (z.inf=5) and (z.gd=0) then write('+25%')

else

if (z.mat>=4) and (z.ukr>=4) and (z.inf>=4) then write('Zvu4aina stupendiya')

else

if (z.mat>=3) and (z.ukr>=3) and (z.inf>=3) and (z.gd=1) then write('Zvu4aina stupendiya')

else write('Net stipendii');

writeln;

n:=n+1;

end;

end;

close(f);

readkey;

end;

procedure Tri;

begin

clrscr;

reset (f);

textcolor(yellow);

writeln(' Stipendiya ');

textcolor(13);

gotoxy(1,2); writeln('#');

gotoxy(4,2); writeln('Grypa');

gotoxy(12,2); writeln('Familiya');

gotoxy(24,2); writeln('Mat');

gotoxy(28,2); writeln('Ukr');

gotoxy(32,2); writeln('Inf');

gotoxy(36,2); writeln('Diyal`nist`');

gotoxy(50,2); writeln('stipendiya');

n:=1;

for i:=1 to filesize(f) do

begin

read(f,z);

if (z.mat=3) and (z.ukr=3) and (z.inf=3) and (z.gd=1) then

begin

textcolor(2);

gotoxy(1,wherey); write(n);

gotoxy(4,wherey); write(z.nomgr);

gotoxy(12,wherey); write(z.prizv);

gotoxy(24,wherey); write(z.mat);

gotoxy(28,wherey); write(z.ukr);

gotoxy(32,wherey); write(z.inf);

gotoxy(36,wherey);

if z.gd=1 then write('y4astvyet') else write('ne y4astvyet');

gotoxy(50,wherey);

if (z.mat=5) and (z.ukr=5) and (z.inf=5) and ( z.gd=1) then write('+50%')

else

if (z.mat=5) and (z.ukr=5) and (z.inf=5) and (z.gd=0) then write('+25%')

else

if (z.mat>=4) and (z.ukr>=4) and (z.inf>=4) then write('Zvu4aina stupendiya')

else

if (z.mat>=3) and (z.ukr>=3) and (z.inf>=3) and (z.gd=1) then write('Zvu4aina stupendiya')

else write('Net stipendii');

writeln;

n:=n+1;

end;

end;

close(f);

readkey;

end;

procedure Sort;

begin

reset(f);

if filesize(f)=0 then write('V baze net zapisej!')

else

begin

i:=1;

while (not eof(f)) do

begin

read(f,z);

m[i]:=z;

i:=i+1;

end;

close(f);

for j:=1 to i do

begin

for n:=1 to i-1 do

begin

if (((m[n].mat+m[n].ukr+m[n].inf)/3)<(m[n+1].mat+m[n+1].ukr+m[n+1].inf)/3) then

begin

z:=m[n];

m[n]:=m[n+1];

m[n+1]:=z;

end;

end;

end;

clrscr;

textcolor(yellow);

gotoxy(1,wherey);writeln('Zda4a sesii stydentamu vidsortovana po serednomy baly:');

textcolor(13);

gotoxy(1,2); writeln('#');

gotoxy(4,2); writeln('Grypa');

gotoxy(15,2); writeln('Familiya');

gotoxy(34,2); writeln('Mat');

gotoxy(38,2); writeln('Ukr');

gotoxy(42,2); writeln('Inf');

gotoxy(46,2); writeln('Sr bal');

for n:=1 to i-1 do

begin

textcolor(2);

srbal:=(m[n].mat+m[n].ukr+m[n].inf)/3;

gotoxy(1,wherey);write(n);

gotoxy(4,wherey);write(m[n].nomgr);

gotoxy(15,wherey);write(m[n].prizv);

gotoxy(35,wherey);write(m[n].mat);

gotoxy(39,wherey);write(m[n].ukr);

gotoxy(43,wherey);write(m[n].inf);

gotoxy(47,wherey);write(srbal:3:2);

writeln;

end;

readln;

end;

end;

end.

end.

Додаток г Лістинг модуля poisk.Tpu

unit poisk;

interface

uses crt,styd;

procedure Sti;

implementation

procedure Sti;

begin

clrscr;

k:=1;

reset(f);

writeln('Vvedite nyjnyu grypy');

readln(gr);

clrscr;

textcolor(yellow);

writeln(gr);

textcolor(13);

gotoxy(1,2); writeln('#');

gotoxy(6,2); writeln('Familiya');

gotoxy(20,2); writeln('Deyatel`nost`');

gotoxy(40,2); writeln('Stipendiya');

if filesize(f)=0 then

begin

textcolor (4+16);

writeln('V baze net zapisei'); textcolor(7)

end

else

for i:=1 to filesize(f) do

begin

read(f,z);

if gr=z.nomgr then

begin

textcolor(2);

gotoxy(1,wherey); write(k);

gotoxy(6,wherey); write(z.prizv);

gotoxy(20,wherey);

if z.gd=1 then write('y4astvyet') else write('ne y4astvyet');

gotoxy(40,wherey);

if (z.mat=5) and (z.ukr=5) and (z.inf=5) and ( z.gd=1) then write('+50%')

else

if (z.mat=5) and (z.ukr=5) and (z.inf=5) and (z.gd=0) then write('+25%')

else

if (z.mat>=4) and (z.ukr>=4) and (z.inf>=4) then write('Zvu4aina stupendiya')

else

if (z.mat>=3) and (z.ukr>=3) and (z.inf>=3) and (z.gd=1) then write('Zvu4aina stupendiya')

else write('Net stipendii');

writeln;

k:=k+1;

end;

end;

close(f);

readkey;

end;

end.