home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
TPTUTOR1.ARC
/
PROG8.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-06-03
|
1KB
|
51 lines
PROGRAM PROG8;
{$U+ Copyright (C), 1985 by Lyle Faurot. All rights reserved.
New Topics: CASE statement
Block statement
}
VAR
Response : Char;
Correct_Response : Boolean;
BEGIN
WriteLn('Turbo Pascal seems to ');
WriteLn;
WriteLn('A. Run faster than other Pascals.');
WriteLn('B. Compile faster than others.');
WriteLn('C. Take less room in memory.');
WriteLn('D. All of the above.');
WriteLn;
REPEAT
Write('Enter your choice - A, B, C, or D: ');
ReadLn(Response);
WriteLn;
CASE Response OF
'A','a',
'B','b',
'C','c' : BEGIN
WriteLn('Correct, but not the best answer.');
WriteLn('Please try again.');
Correct_Response := False;
END;
'D','d' : BEGIN
WriteLn('Correct - these all seem to be true.');
Correct_Response := True;
END;
ELSE
BEGIN
WriteLn(Response,' was not one of the choices. Try again.');
Correct_Response := False;
END;
END; {CASE}
UNTIL Correct_Response;
END.