Silahkan dicoba ;p
##
Source Code disini ;puses wincrt;Type tabel_mhs = recordNIM : String;Nama : String ;Nilai : Integer ;end;Var mhs : array [1..10] of tabel_mhs;i, j, n : integer;procedure urut;var t : tabel_mhs;beginfor i := 1 to n-1 dofor j := i+1 to n doif mhs[i].nilai<mhs[j].nilai thenbegint:= mhs[i];mhs[i]:=mhs[j];mhs[j]:=t;end;end;procedure cetak;beginwriteln(' -------------------------------------------------------------');writeln('| NIM | NAMA | NILAI |');writeln(' -------------------------------------------------------------');for i := 1 to n dowriteln('| ',mhs[i].nim:10,' |',mhs[i].nama:15,' |',mhs[i].nilai:10,' |');writeln(' -------------------------------------------------------------');end;beginwriteln;Writeln(' TABEL NIM MAHASISWA ');writeln;Write('Masukkan Jumlah Mahasiswa = ');readln(n);writeln;for i := 1 to n dobeginwriteln('Input ',i);Write('NIM = '); readln(mhs[i].nim);Write('Nama = '); readln(mhs[i].nama);Write('Nilai = '); readln(mhs[i].nilai);writeln;end;urut;cetak;end.
Contoh program by v3.rar
Tidak ada komentar:
Posting Komentar