Program face; (*This program puts the format data in file fac.dat that the LIST program reads*) Type number = Packed array [1..2] of char; Var fac : Text; i,j,k : Integer; nbr : number; Function enter : Integer; (*Converts characters to integers*) Label 5; Var count,j : Integer; Begin 5: For count := 1 to 2 do (*Initialize nbr array*) nbr[count] := '0'; count := 0; while NOT eoln do begin count := count + 1; If count > 2 then (*Number limited to 2 digits*) begin write('Number entered exceeds 2 digits. Enter again: '); readln; goto 5 end; read(nbr[count]); If (nbr[1] = ' ') or (nbr[1] = '0') then (*First digit cannot be blank or zero*) begin write('First digit cannot be zero or blank. Enter again: '); readln; goto 5 end; If (nbr[count] < '0') or (nbr[count] > '9') then (*Only numerials allowed*) begin write('Bad number. Enter again: '); readln; goto 5 end end; readln; j := 0; For count := 1 to count do (*Convert nbr array to an integer*) j := j * 10 + ord(nbr[count]) - ord('0'); enter := j End; (********** MAIN PROGRAM **********) Begin write('Enter the number of lines for the top margin: '); i := enter; writeln; write('Enter the number of lines for the bottom margin: '); j := enter; writeln; write('Enter the total number of lines on a page: '); k := enter; k := k - (i + j + 1); rewrite(fac,'DK0:FAC.DAT'); writeln(fac,i); writeln(fac,k); writeln(fac,j); close(fac) End.