1 (*  This program shows how eof works with the keyboard *)
 2 
 3 PROGRAM eofTest(input, output, infile, outfile);
 4 VAR     sideA, sideB, height : integer;
 5          area : real;
 6 
 7 
 8 BEGIN
 9     write('This program computes the area of a trapezoid as long as you ');
10     writeln (' continue to enter data ');
11     writeln('Enter 3 integers, separated by a space, for the sides and height:');
12 
13     REPEAT
14        readln(sideA, sideB, height);
15        writeln (' The numbers you entered are: ', sideA:5, sideB:5, height:5);
16 
17        area := ((sideA + sideB)/2)*height;
18        writeln('Area using /   is: ', area:5:3);
19        area := ((sideA + sideB)div 2)*height;
20        writeln('Area using DIV is: ', area:5:3);
21        writeln('Enter 3 numbers, separated by a space, for the sides and height:');
22        writeln (' to stop, hit ctrl-z ');
23    UNTIL eof;
24 END.