помогите пожалуйста
Задание
Код
unit felkurs;
interface
uses CRT;
type
klient=record
imya:string;
proc:integer;
summa:integer;
ostatok:integer;
end;
stroenie=record
posetitel:klient;
stoimost:integer;
firma:integer;
tipstr:string;
end;
procedure vivod;
procedure zapros;
procedure vstavka;
procedure stoimost;
procedure sozdanie;
procedure poisk;
implementation
var g: file of stroenie;
st:integer;
building: stroenie;
procedure vstavka;
var
flag:char;
begin
assign(g,'base.txt');
reset(g);
repeat
clrscr;
seek(g,filesize(g));
Writeln('Kolichestvo klientov v baze dannih: ',filesize(g));
Write('Vvedite imya klienta: ');
readln(building.posetitel.imya);
Write('Vvedite procent po kreditu: ');
readln(building.posetitel.proc);
Write('Vvedite summu vklada v banke: ');
readln(building.posetitel.summa);
Write('Vvedite neviplachenuju summu: ');
readln(building.posetitel.ostatok);
Write('Vvedite stoimost stroeniya: ');
readln(building.stoimost);
Write('Vvedite tipstr stroeniya: ');
readln(building.tipstr);
Write('Vvedite firmu podryadchika: ');
readln(building.firma);
write(g,building);
write('Dlya vihoda najmite "q" dlya vvoda novoj zapisi- lubuju klavishu: ');
read(flag);
until (flag='q') or (flag='Q');
close(g);
end;
procedure poisk;
var
s:integer;
c:boolean;
begin
clrscr;
c:=false;
Write('Vvedite firmu podryadchika: ');
readln(s);
assign(g,'base.txt');
reset(g);
Writeln('Resultat poiska:');
While not EOF(g) do
begin
Read(g,building);
with building do
if firma=s then
begin
Writeln('Imya: ',posetitel.imya,' Ostatok kredita: ',posetitel.ostatok,' Summa Vklada:'
,posetitel.summa,' Procent:',posetitel.proc);
c:=true;
end;
end;
if c=false then
Writeln('nichego ne naydeno');
close(g);
Write('Nagmite lubuy klavishy dlya vozvrata v menu');
readln;
end;
procedure stoimost;
var
v:boolean;
begin
clrscr;
v:=false;
Write('Vvedite stoimost stroeniya: ');
readln(st);
assign(g,'data.txt');
reset(g);
Writeln('Resultat poiska:');
While not EOF(g) do
begin
Read(g,building);
with building do
if stoimost=st then
begin
Writeln('Imya: ',posetitel.imya,' Ostatok kredita: ',posetitel.ostatok,' Summa Vklada:',
posetitel.summa,' Procent:',posetitel.proc);
v:=true;
end;
end;
if v=false then
Writeln('nichego ne naydeno');
close(g);
Write('Nagmite lubuy klavishy dlya vozvrata v menu');
readln;
end;
procedure zapros;
var
flag:boolean;
begin
clrscr;
flag:=false;
assign(g,'base.txt');
reset(g);
Writeln('klienti u kotorih summa vklada v banke menshe toimosti stroeniya:');
While not EOF(g) do
begin
Read(g,building);
with building do
if posetitel.ostatok<st then
begin
Writeln('Imya:',posetitel.imya,' Stoimost:',stoimost,' tipstr:',tipstr,' Firm:',firma,' Summa vklada:',posetitel.summa);
flag:=true;
end;
end;
if flag=false then
Write('klientov ne naydeno');
close(g);
Write('Nagmite lubuy klavishy dlya vozvrata v menu');
readln;
end;
procedure sozdanie;
var
c:integer;
flag:char;
begin
clrscr;
Writeln('esli prodolgit basa budet udalena');
Writeln('"y"/"n" ');
readln(flag);
if (flag='n') or (flag='y') then
begin
assign(g,'base.txt');
rewrite(g);
Write('basa sozdana nagmite klavishu dlya prodolgeniya');
readln;
clrscr;
vstavka;
end
else
begin
Writeln('Sozdanie novoj bazi otmeneno');
Write('Nagmite lubuju klavishu dlya vihoda v menu');
readln;
end;
end;
procedure vivod;
var
i:integer;
begin
clrscr;
assign(g,'base.txt');
reset(g);
i:=1;
While not EOF(g) do
begin
Read(g,building);
with building do
begin
write(i,'. ');
Writeln('Imya: ',posetitel.imya,' Ostatok: ',posetitel.ostatok,' Vklad: ',posetitel.summa,' Procent: '
,posetitel.proc,' posetitel:',tipstr);
i:=i+1;
end;
end;
close(g);
Write('nagmite klavishu dlya vihoda v menu');
readln;
end;
end.
interface
uses CRT;
type
klient=record
imya:string;
proc:integer;
summa:integer;
ostatok:integer;
end;
stroenie=record
posetitel:klient;
stoimost:integer;
firma:integer;
tipstr:string;
end;
procedure vivod;
procedure zapros;
procedure vstavka;
procedure stoimost;
procedure sozdanie;
procedure poisk;
implementation
var g: file of stroenie;
st:integer;
building: stroenie;
procedure vstavka;
var
flag:char;
begin
assign(g,'base.txt');
reset(g);
repeat
clrscr;
seek(g,filesize(g));
Writeln('Kolichestvo klientov v baze dannih: ',filesize(g));
Write('Vvedite imya klienta: ');
readln(building.posetitel.imya);
Write('Vvedite procent po kreditu: ');
readln(building.posetitel.proc);
Write('Vvedite summu vklada v banke: ');
readln(building.posetitel.summa);
Write('Vvedite neviplachenuju summu: ');
readln(building.posetitel.ostatok);
Write('Vvedite stoimost stroeniya: ');
readln(building.stoimost);
Write('Vvedite tipstr stroeniya: ');
readln(building.tipstr);
Write('Vvedite firmu podryadchika: ');
readln(building.firma);
write(g,building);
write('Dlya vihoda najmite "q" dlya vvoda novoj zapisi- lubuju klavishu: ');
read(flag);
until (flag='q') or (flag='Q');
close(g);
end;
procedure poisk;
var
s:integer;
c:boolean;
begin
clrscr;
c:=false;
Write('Vvedite firmu podryadchika: ');
readln(s);
assign(g,'base.txt');
reset(g);
Writeln('Resultat poiska:');
While not EOF(g) do
begin
Read(g,building);
with building do
if firma=s then
begin
Writeln('Imya: ',posetitel.imya,' Ostatok kredita: ',posetitel.ostatok,' Summa Vklada:'
,posetitel.summa,' Procent:',posetitel.proc);
c:=true;
end;
end;
if c=false then
Writeln('nichego ne naydeno');
close(g);
Write('Nagmite lubuy klavishy dlya vozvrata v menu');
readln;
end;
procedure stoimost;
var
v:boolean;
begin
clrscr;
v:=false;
Write('Vvedite stoimost stroeniya: ');
readln(st);
assign(g,'data.txt');
reset(g);
Writeln('Resultat poiska:');
While not EOF(g) do
begin
Read(g,building);
with building do
if stoimost=st then
begin
Writeln('Imya: ',posetitel.imya,' Ostatok kredita: ',posetitel.ostatok,' Summa Vklada:',
posetitel.summa,' Procent:',posetitel.proc);
v:=true;
end;
end;
if v=false then
Writeln('nichego ne naydeno');
close(g);
Write('Nagmite lubuy klavishy dlya vozvrata v menu');
readln;
end;
procedure zapros;
var
flag:boolean;
begin
clrscr;
flag:=false;
assign(g,'base.txt');
reset(g);
Writeln('klienti u kotorih summa vklada v banke menshe toimosti stroeniya:');
While not EOF(g) do
begin
Read(g,building);
with building do
if posetitel.ostatok<st then
begin
Writeln('Imya:',posetitel.imya,' Stoimost:',stoimost,' tipstr:',tipstr,' Firm:',firma,' Summa vklada:',posetitel.summa);
flag:=true;
end;
end;
if flag=false then
Write('klientov ne naydeno');
close(g);
Write('Nagmite lubuy klavishy dlya vozvrata v menu');
readln;
end;
procedure sozdanie;
var
c:integer;
flag:char;
begin
clrscr;
Writeln('esli prodolgit basa budet udalena');
Writeln('"y"/"n" ');
readln(flag);
if (flag='n') or (flag='y') then
begin
assign(g,'base.txt');
rewrite(g);
Write('basa sozdana nagmite klavishu dlya prodolgeniya');
readln;
clrscr;
vstavka;
end
else
begin
Writeln('Sozdanie novoj bazi otmeneno');
Write('Nagmite lubuju klavishu dlya vihoda v menu');
readln;
end;
end;
procedure vivod;
var
i:integer;
begin
clrscr;
assign(g,'base.txt');
reset(g);
i:=1;
While not EOF(g) do
begin
Read(g,building);
with building do
begin
write(i,'. ');
Writeln('Imya: ',posetitel.imya,' Ostatok: ',posetitel.ostatok,' Vklad: ',posetitel.summa,' Procent: '
,posetitel.proc,' posetitel:',tipstr);
i:=i+1;
end;
end;
close(g);
Write('nagmite klavishu dlya vihoda v menu');
readln;
end;
end.