Nilai Mahasiswa

Nilai siswa

copy code start from here:

program data_mhs;
uses wincrt;

label ulang;
const max= 100;

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

var
A       :tkumpulansiswa;
i,n,no  :integer;
p       :string[10];
nilai   :integer;
NA      :byte;
jawab   :char;
begin
 ulang:
clrscr;
       gotoxy(20,wherey);write(‘Masukkan Jumlah Siwa:’);readln(n);
       writeln;
       gotoxy(20,wherey);writeln(‘Masukan Data ‘);
       gotoxy(20,wherey);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);
          write(‘Nilai       :’);readln(nilai[1]);
          writeln(‘————————–‘);
         
          end;
       end;
   begin
   clrscr;
      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
   inc(no);
   na:=nilai[1];
        case na of
        00..59 : p:=’Kurang’;
        60..74 : p:=’Cukup’;
        75..84 : p:=’Baik’;
        85..100: p:=’Amat Baik’;
       End;
        writeln (no,”:2,nim:1, ”:2, nama:8,”:2, Mkul:12,”:2,na:16, p:21,”:0);
    end;
    writeln(‘—————————————————————————–‘);
   end;

  write(‘Apakah anda mau mengulang pengisian data? (Y/T)=’); readln(jawab);
  if jawab = ‘Y’ then goto ulang;
readln;
end.

Iklan

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