MID and UAS value

Posted on 21.06.2010

0


program beri_nilai(Output);
uses crt;
type
   jenis_ujian=(mid,uas); // nilai ordinalnya : 0,1
   nilai= array[1..10,jenis_ujian] of byte;
var
   _n : nilai;
   i,j : byte;
begin
   clrscr;
   randomize;
   for i:=1 to 10 do begin
      for j:=ord(mid) to ord(uas) do begin
         if (j=ord(mid)) then begin
            _n[i,mid]:=random(100);
            write(‘Nilai Mid siswa-‘,i,’ : ‘,_n[i,mid]);
            write(‘ ‘:4);
         end
         else begin
            _n[i,uas]:=random(100);
            write(‘Nilai UAS siswa-‘,i,’ : ‘,_n[i,uas]);
         end;
      end;
      writeln;
   end;

   readln;
end.

Posted in: Pascal Code