program Table_dan_sorting;
uses crt;
const
garis=’========================================================’;
var
nama : array [1..100] of string[5];
npm : array [1..100] of string[8];
kelas : array [1..100] of string[15];
min, temp : string;
n,i,bar,kelompok,tempatnya_min : INTEGER;
begin
clrscr;
write(‘berapa data yang ingin dimasukkan : ‘);
readln(n);
for i:= 1 to n do
BEGIN
CLRSCR;
GOTOXY(30,4); WRITE(‘data – ‘,i:2);
GOTOXY(10,7); WRITE(‘nama : ‘); READLN(nama[i]);
GOTOXY(10,8); WRITE(‘npm : ‘); READLN(npm[i]);
GOTOXY(10,9); WRITE(‘kelas : ‘); READLN(kelas[i]);
END;

FOR kelompok := 1 to n do
BEGIN
min := kelas[kelompok];
FOR i := kelompok to n do
BEGIN
IF (kelas[i] BEGIN
min := kelas[i];
tempatnya_min := i;
END;
END;

temp := kelas[kelompok];
KELAS[kelompok] := kelas[tempatnya_min];
KELAS[tempatnya_min] := temp;

temp := npm[kelompok];
NPM[kelompok] := npm[tempatnya_min];
NPM[tempatnya_min] := temp;

temp := nama[kelompok];
NAMA[kelompok] := nama[tempatnya_min];
NAMA[tempatnya_min] := temp;
end;

CLRSCR;
GOTOXY(5,4); WRITE(garis);
GOTOXY(5,5); WRITE(‘no’);
GOTOXY(9,5); WRITE(‘npm’);
GOTOXY(20,5); WRITE(‘nama’);
GOTOXY(37,5); WRITE(‘kelas’);
GOTOXY(47,5); WRITE(‘tanda tangan’);
GOTOXY(5,6); WRITE(garis);
bar:=7;
FOR i:= 1 TO n DO
BEGIN
GOTOXY(5,bar); WRITELN(i:2);
GOTOXY(9,bar); WRITELN(npm[i]);
GOTOXY(20,bar); WRITELN(nama[i]);
GOTOXY(37,bar); WRITELN(kelas[i]);
GOTOXY(47,bar); WRITELN(‘. . .’);
bar:=bar+1;
END;
READLN;
END.

mohon maaf jika ada yang salah.
maklum masih belajar