PASCAL : program nilai ujian
PROGRAM
nilai_ujian;
USES
CRT;
VAR
nilai : real;
nil_huruf
: char;
BEGIN
CLRSCR;
WRITE(‘Tulis
nilai ujian anda (0-100) : ‘);
READLN(nilai);
SOUND(1000);
DELAY(1000); NOSOUND;
IF
nilai>=80 THEN
nil_huruf:=’A’
ELSE
IF nilai>=70 THEN
nil_huruf:=’B’
ELSE
IF nilai>=60 THEN
nil_huruf:=’C’
ELSE
IF nilai>=20 THEN
nil_huruf:=’D’
ELSE
nil_huruf:=’E’;
WRITELN(‘Nilai
Anda : ‘,nil_huruf);
READLN;
END.
Komentar
Posting Komentar