Kamis, 05 Januari 2012

MENENTUKAN GRADE NILAI

Program Grade Nilai Pascal menggunakan statemen Case Of :


program grade_nilai;
uses wincrt;
var
   x : integer;
   Grade : string;
begin
clrscr;
write ('nilai anda = '); readln(x);
      case x of
      85..100: Grade :='A';
      75..84  : Grade :='B';
      65..74  : Grade :='C';
      55..64  : Grade :='D';
      0..54   : Grade :='E';
else
    grade :='Tidak ada Nilai';
end;
writeln ('Grade = ',Grade);
readln;
end.

0 komentar:

Posting Komentar