| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- PROGRAM PROG7;
- {$U+ Copyright (C), 1985 by Lyle Faurot. All rights reserved.
- New Topics: REPEAT statement
- CHAR data type
- }
- 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;
- If (Response = 'D') or (Response = 'd')
- THEN
- Correct_Response := True
- ELSE
- Correct_Response := False;
- If Correct_Response
- THEN
- WriteLn('Right!')
- ELSE
- WriteLn('Wrong choice, try again.');
- UNTIL Correct_Response;
- END.
|