record bagian dua

program ulang;
uses wincrt;

const max= 100;

type
Tsiswa = record
   NIM:string[8];
   nama:string[25];
   mkul:string [20];
   Nilai:array [1..3] of real;
end;
tkumpulansiswa = array [1..max] of tsiswa;

var
A:tkumpulansiswa;
i,n,no:integer;
NA:real;
begin
clrscr;
       write(‘Masukkan Jumlah Siwa:’);readln(n);
       writeln;
       writeln(‘Masukan Data ‘);
       writeln(‘  ————————-‘);
       writeln;
         for i := 1 to n do
         begin
          writeln(‘data siswa ke-‘,i);
          writeln(‘————————‘);
          writeln;
          with A[i] do begin
          writeln(‘No          :’,i);
          write(‘Nim         :’);readln(A[i].nim);
          write(‘Nama        :’);readln(A[i].nama);
          write(‘Mata Kuliah :’);readln(A[i].mkul);
          writeln(‘————————–‘);
          write(‘         Nilai Kuis : ‘);readln(nilai[1]);
          write(‘         Nilai UTS  : ‘);readln(nilai[2]);
          write(‘         Nilai UAS  : ‘);readln(nilai[3]);
          writeln;
          end;
       end;
   begin
      writeln;
      writeln(‘daftar siswa   ‘);
      writeln(‘—————————————————————————-‘);
      writeln(‘No’,”:1, ‘nim’,”:7, ‘nama’,”:9,’Mata Kuliah’,”:10, ‘Nilai’,”:12,’Grade’,”:14);
      writeln(‘—————————————————————————–‘);
   for i:= 1 to n do
   with A[i] do begin
        NA:= (0.2*nilai[1])+(0.3*nilai[2])+(0.5*nilai[3]);
        writeln (no,”:2,nim:1, ”:2, nama:10,”:2, Mkul:12,”:2,NA:18:0);
    end;
   end;
readln;
end.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s