uses crt; type R1=record N:integer; N1,N2,N3:string[50]; adress:string[255]; tel:string[7]; year:integer; class:string[3]; sex:char; ball:real; del:boolean; end; R2=RECORD N,m1,m2,m3,m4,ex,year:INTEGER; del:boolean; end; var X:R1; Y:R2; N0:integer; BASE:file of R1; MARK:file of R2; Procedure createBD; begin Assign(BASE,'BASEFILE.DAT'); Rewrite(BASE); Close(BASE); Assign(MARK,'MARK.DAT'); Rewrite(MARK); Close(MARK); end; PROCEDURE AddinBD; var st:char; Begin repeat X.N:=N0; Writeln('Enter Name of person'); Readln(x.n1); Writeln('Enter Surname of person'); Readln(x.n2); Writeln('Enter Patronymic of person'); Readln(x.n3); Writeln('Enter Adress of person'); Readln(x.adress); Writeln('Enter Telephone of person'); Readln(x.tel); Writeln('Enter Year of birth of person'); Readln(x.year); Writeln('Enter Class of person'); Readln(x.n1); Writeln('Enter Sex of person'); Readln(x.sex); x.del:=false; Y.N:=N0; Writeln('Enter 1st quater mark of person'); Readln(Y.m1); Writeln('Enter 2nd quater mark of person'); Readln(Y.m2); Writeln('Enter 3rd quater mark of person'); Readln(Y.m3); Writeln('Enter 4th quater mark of person'); Readln(Y.m4); Writeln('Enter Exam mark of person'); Readln(Y.ex); Writeln('Enter Year mark of person'); Readln(Y.year); y.del:=false; x.ball:=(Y.m1+Y.m2+Y.m3+Y.m4+Y.ex+Y.year)/6; Write(BASE,X); Write(MARK,Y); writeln('Vvesty dannie ob eshe odnom stydente ? (y/n)'); readln(st); INC(N0); Until st='n'; end; Procedure DELWWYL; var i,j,k:integer; q:char; Procedure del(var i:integer); begin seek(BASE,i-1); Read(BASE,x); x.del:=true; Write(BASE,x); seek(MARK,i-1); Read(MARK,y); y.del:=true; Write(MARK,y); end; begin Repeat Writeln('What number of BD records do you want to delete?'); Readln(i); del(i); Writeln('Do you want to delete any other record???'); Writeln('Write "n" for NO or any other symbol for yes'); Readln(q); Until q='n'; Writeln('Appending changes, formatting BD...'); j:=filesize(base); seek(BASE,j-1); Read(BASE,x); seek(mark,j-1); read(mark,y); i:=0; repeat seek(base,i); end; begin Assign(BASE,'BASEFILE.DAT'); Assign(MARK,'MARK.DAT'); reset(base); reset(mark); Addinbd; close(base); close(mark); end.