PROGRAM Binary (Input,Output,PeopleFile);

TYPE
   PersonRec = Record
        LastName : String[20];
        FirstName : String[12];
        Sex : (Male,Female);
        MaritalStatus : Char;
      End;
    PersonFile = FILE OF PersonRec;

VAR
   Employee : PersonRec;
   People : ARRAY[1..100] OF PersonRec;
   PeopleFile : PersonFile;
   I : Integer;
   Num : Real;

PROCEDURE GetInfo (Var Emp : PersonRec);
Var
  Ch : Char;
Begin
   Write('Last Name: ');
   Readln(Emp.LastName);
   Write('First Name: ');
   Readln(Emp.FirstName);
   Write('Sex : ');
   Readln(Ch);
   IF (Ch = 'm') OR (Ch = 'M') THEN
      Emp.Sex := Male
   ELSE
      Emp.Sex := Female;
   Write('M Status ');
   Readln(Emp.MaritalStatus);
End;



BEGIN
   Randomize;
   Assign(PeopleFile,'Test');
   Reset(PeopleFile);

   WHILE NOT EOF(PeopleFile) DO
    (*FOR I := 1 to 3 DO*)
     Begin
    (*  GetInfo(Employee);    *)
     (* Num := 3.14159 * Random(100);   *)
      Read(PeopleFile,Employee);
      Writeln(Employee.LastName,Employee.MaritalStatus);
    End;

   Close(PeopleFile);
END.
