Wednesday, December 21, 2011

Program Grade Nilai - Pascal

Berikut adalah 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.

Hasilnya :
Nilai Anda = 80
Grade = B


Related Post

4 comments:

Mohon tinggalkan jejak/komentar sobat disini. Dilarang SPAM. Okey...