Hi,
i don't know your compiler, but there seem to be a bunch of syntax errors. i fixed them so far for D6. Also i suggest to use a function for getting the user response:
Code:
PROGRAM PRO5(input,output);
// D6 syntax
// USES crt;
{$APPTYPE CONSOLE}
VAR
score:real;
answer:char;
function GetKey(validchars:string):char;
var key:char;
begin
repeat
readln(key);
key:=upcase(key);
until pos(key,validchars)>0;
result:=key;
end;
PROCEDURE Q_1;
BEGIN
writeln('What is the abbreviation for "fourth generation language"');
writeln('A 4GL');
writeln('B FGL');
writeln('C 4TH GL');
Answer:=GetKey('ABC');
If (answer = 'B') or (answer='C') THEN
writeln('Sorry you are incorrect')
ELSE
writeln('You are correct');
score:= score + 1;
END;
PROCEDURE Q_2;
BEGIN
repeat
writeln('What two abbreviations are used for "bits per second"');
writeln('A baud rate + bps');
writeln('B bps + byte');
writeln('C bit + baud rate');
readln (answer);
answer:=upcase(answer);
until (answer= 'A') OR (answer='B') OR (answer='C');
If (answer = 'B') or (answer='C') THEN
writeln('Sorry you are incorrect')
ELSE
writeln('You are correct');
score:= score + 1;
END;
PROCEDURE Q_3;
BEGIN
repeat
writeln('What abbreviation is used for "computer output on microfilm"');
writeln('A COM');
writeln('B COOM');
writeln('C COPOM');
readln (answer);
answer:=upcase(answer);
until (answer= 'A') OR (answer='B') OR (answer='C');
If (answer = 'B') or (answer='C') THEN
writeln('Sorry you are incorrect')
ELSE
writeln('You are correct');
score:= score + 1;
END;
BEGIN
repeat
// clrscr;
Q_1;
Q_2;
Q_3;
writeln('score = ', score, 'out of 3');
readln;
score:=0;
writeln('Do want to play again press Y for yes and N for no');
readln(answer);
// readln; ?? not really needed
answer:=upcase(answer);
UNTIL answer='N';
END.