, , , , , . .

 

 

!

 

:

:

 

 

 

?

StudentHelp, , MS Word. , , antiplagiat.ru, etxt.ru advego.ru. StudentHelp , Word .


:


" "

:

: . : 14.08.2012. : 2010. : 22. antiplagiat.ru: < 30%

():



()

()












___________________

___________________

___________________
.. ___________________
___________________



:








1.


:

.


:

, . , , , . , , .

:

: phone.dat . temp.dat, phone.dat , phone.dat , temp.dat phone.dat.

.

Phone, :
SurnameS - 15 , ;
NameS - 15 , ;
PhoneS - 15 , .
AddressS - 50 , .

:
PhoneF - , ;
PhoneR - (Phone), .
- 1 600 Phone, .
WritePhone - phone.dat . Assign PhoneF. Reset . , : , , Writeln. Close, , .
procedure WritePhone;
begin
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
ClrScr;
writeln(' :');
writeln;
while not Eof(PhoneF) do
begin
PhoneR.SurnameS:='';
PhoneR.NameS:='';
PhoneR.PhoneS:='';
PhoneR.AddressS:='';
read(PhoneF,PhoneR);
writeln;
write(PhoneR.SurnameS);
write(' ',PhoneR.NameS);
write('',PhoneR.PhoneS);
write('',PhoneR.AddressS);
end;
Close(PhoneF);
writeln;
writeln;
write(' ...');
ReadKey;
end;
AddPhone - . Assign Reset phone.dat . Writeln Readln , , . .
procedure AddPhone;
begin
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
while not Eof(PhoneF) do Read(PhoneF,PhoneR);
PhoneR.SurnameS:='';
PhoneR.NameS:='';
PhoneR.PhoneS:='';
PhoneR.AddressS:='';
ClrScr;
writeln(' :');
writeln;
Write(' :');
readln(PhoneR.SurnameS);
write(' :');
readln(PhoneR.NameS);
write(' :');
readln(PhoneR.PhoneS);
write(' :');
readln(PhoneR.AddressS);
write(PhoneF,PhoneR);
Close(PhoneF);
writeln;
writeln(' !!!');
writeln;
write(' ...');
ReadKey;
end;
DeletePhone - . :
temp - , ;
Nazv - 15 , .
Assign Reset phone.dat . Assign Reset temp.dat . Writeln Readln ( ) , Nazv. SurnameS PhoneF Nazv, temp.dat, . , . phone.dat Erase, temp.dat phone.dat Rename.
procedure DeletePhone;
var temp : file of Phone;
Nazv : string[15];
begin
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
Assign(temp,'Phone\temp.dat');
Rewrite(temp);
PhoneR.SurnameS:='';
PhoneR.NameS:='';
PhoneR.PhoneS:='';
PhoneR.AddressS:='';
ClrScr;
writeln(' :');
writeln;
Write(' :');
readln(Nazv);
while not Eof(PhoneF) do
begin
Read(PhoneF,PhoneR);
if PhoneR.SurnameS<>Nazv then Write(temp,PhoneR);
end;
Close(temp);
Close(PhoneF);
Erase(PhoneF);
Rename(temp,'Phone\phone.dat');
writeln;
writeln(' !!!');
writeln;
write(' ...');
ReadKey;
end;
EditPhone - . DeletePhone. , , , , .
procedure EditPhone;
var Nazv : string[15];
temp : file of Phone;
begin
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
Assign(temp,'Phone\temp.dat');
Rewrite(temp);
PhoneR.SurnameS:='';
PhoneR.NameS:='';
PhoneR.PhoneS:='';
PhoneR.AddressS:='';
ClrScr;
writeln(' :');
writeln;
Write(' , :');
readln(Nazv);
while not Eof(PhoneF) do
begin
PhoneR.SurnameS:='';
PhoneR.NameS:='';
PhoneR.PhoneS:='';
PhoneR.AddressS:='';
Read(PhoneF,PhoneR);
if PhoneR.SurnameS<>Nazv then Write(temp,PhoneR);
end;
writeln;
write(' :');
readln(PhoneR.SurnameS);
write(' :');
readln(PhoneR.NameS);
write(' :');
readln(PhoneR.PhoneS);
write(' :');
readln(PhoneR.AddressS);
write(temp,PhoneR);
Close(temp);
Close(PhoneF);
Erase(PhoneF);
Rename(temp,'Phone\phone.dat');
writeln;
writeln(' !!!');
writeln;
write(' ...');
ReadKey;
end;
FindSurname - . :
k - , ;
Nazv - 15 , .
k 0. Assign Reset phone.dat . Writeln Readln ( ) , Nazv. SurnameS Nazv , k . k . .
procedure FindSurname;
var Nazv : string[15];
k : integer;
begin
k:=0;
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
ClrScr;
writeln(' :');
writeln;
Write(' :');
readln(Nazv);
while not Eof(PhoneF) do
begin
PhoneR.SurnameS:='';
PhoneR.NameS:='';
PhoneR.PhoneS:='';
PhoneR.AddressS:='';
read(PhoneF,PhoneR);
if PhoneR.SurnameS=Nazv then
begin
writeln;
write(PhoneR.SurnameS);
write(' ',PhoneR.NameS);
write('',PhoneR.PhoneS);
write('',PhoneR.AddressS);
k:=k+1;
end;
end;
Close(PhoneF);
writeln;
writeln;
writeln(' , : ',k);
writeln;
write(' ...');
ReadKey;
end;
FindPhone - . FindSurname, : PhoneS, SurnameS.
procedure FindPhone;
var Nazv : string[15];
k : integer;
begin
k:=0;
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
ClrScr;
writeln(' :');
writeln;
Write(' :');
readln(Nazv);
while not Eof(PhoneF) do
begin
PhoneR.SurnameS:='';
PhoneR.NameS:='';
PhoneR.PhoneS:='';
PhoneR.AddressS:='';
read(PhoneF,PhoneR);
if PhoneR.PhoneS=Nazv then
begin
writeln;
write(PhoneR.SurnameS);
write(' ',PhoneR.NameS);
write('',PhoneR.PhoneS);
write('',PhoneR.AddressS);
k:=k+1;
end;
end;
Close(PhoneF);
writeln;
writeln;
writeln(' , : ',k);
writeln;
write(' ...');
ReadKey;
end;
SortSurname - . phone.dat, . . .
procedure SortSurname;
var i,j,c: integer;
tr: Phone;
begin
c:=0;
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
ClrScr;
writeln(' :');
writeln;
while not Eof(PhoneF) do begin
inc(c,1);
read(PhoneF,a[c]);
end;
for i:=1 to c do
for j:=1 to c-1 do begin
if a[j].SurnameS>a[j+1].SurnameS then begin
tr:=a[j+1];
a[j+1]:=a[j];
a[j]:=tr;
end;
end;
for i:=1 to c do begin
writeln;
write(a[i].SurnameS);
write(' ',a[i].NameS);
write('',a[i].PhoneS);
write('',a[i].AddressS);
end;
Close(PhoneF);
writeln;
writeln;
write(' ...');
ReadKey;
end;
SortAddress SortPhone - SortSurname, .
procedure SortAddress;
var i,j,c: integer;
tr: Phone;
begin
c:=0;
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
ClrScr;
writeln(' :');
writeln;
while not Eof(PhoneF) do begin
inc(c,1);
read(PhoneF,a[c]);
end;
for i:=1 to c do
for j:=1 to c-1 do begin
if a[j].AddressS>a[j+1].AddressS then begin
tr:=a[j+1];
a[j+1]:=a[j];
a[j]:=tr;
end;
end;
for i:=1 to c do begin
writeln;
write(a[i].SurnameS);
write(' ',a[i].NameS);
write('',a[i].PhoneS);
write('',a[i].AddressS);
end;
Close(PhoneF);
writeln;
writeln;
write(' ...');
ReadKey;
end;
procedure SortPhone;
var i,j,c: integer;
tr: Phone;
begin
c:=0;
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
ClrScr;
writeln(' :');
writeln;
while not Eof(PhoneF) do begin
inc(c,1);
read(PhoneF,a[c]);
end;
for i:=1 to c do
for j:=1 to c-1 do begin
if a[j].PhoneS>a[j+1].PhoneS then begin
tr:=a[j+1];
a[j+1]:=a[j];
a[j]:=tr;
end;
end;
for i:=1 to c do begin
writeln;
write(a[i].SurnameS);
write(' ',a[i].NameS);
write('',a[i].PhoneS);
write('',a[i].AddressS);
end;
Close(PhoneF);
writeln;
writeln;
write(' ...');
ReadKey;
end;
SortType - . Writeln Readln , . :
1. - WritePhone;
2. - SortSurname;
3. - SortAddress;
4. - SortPhone;
5. - ;
procedure SortType;
var b: integer;
begin
repeat
begin
ClrScr;
writeln('" " - ');
writeln;
writeln('1. ');
writeln('2. ');
writeln('3. ');
writeln('4. ');
writeln('----------------------------');
writeln('5. ');
writeln;
write(' : ');
readln(b);
case b of
1 : WritePhone;
2 : SortSurname;
3 : SortAddress;
4 : SortPhone;
end;
end;
until b=5;
end;
PhoneMenu - . Writeln Readln , . :
1. - WritePhone;
2. - AddPhone;
3. - DeletePhone;
4. - EditPhone;
5. - FindSurname;
6. - FindPhone;
7. - ;
procedure PhoneMenu;
var b: integer;
begin
repeat
begin
ClrScr;
writeln('" " - ');
writeln;
writeln('1. ');
writeln('2. ');
writeln('3. ');
writeln('4. ');
writeln('5. ');
writeln('6. ');
writeln('----------------------------');
writeln('7. ');
writeln;
write(' : ');
readln(b);
case b of
1 : SortType;
2 : AddPhone;
3 : DeletePhone;
4 : EditPhone;
5 : FindSurname;
6 : FindPhone;
end;
end;
until b=7;
end;
ClrScr PhoneMenu.
begin
ClrScr;
PhoneMenu;
end.




. . phone.dat Phone, Turbo Pascal.


.

, . . , , , 2000 .


1. .

{ phone.dat
Phone,

Turbo Pascal}
program Phonebook;
uses Crt;
type Phone = record
SurnameS : string[15];
NameS : string[15];
PhoneS : string[15];
AddressS: string[50];
end;
var PhoneF : file of Phone;
PhoneR : Phone;
a : array[1..600] of Phone;
procedure WritePhone;
begin
Assign(PhoneF,'Phone\phone.dat');
Reset(PhoneF);
ClrScr;
writeln(' :');
writeln;
while not Eof(PhoneF) do
..................



90% antiplagiat.ru, etxt.ru advego.ru




* . , .