program mahasiswa;
uses crt;
const
elemen =10;
type
nmatkul=record
nim:integer;
nama:string[30];
nilai:integer;
isi :array
[1..elemen] of string;
atas:0..elemen;
end;
var
isi:array[1..elemen]
of nmatkul;
t :nmatkul;
i :integer;
m,nim,nilai :integer;
nama :string;
procedure awal
(var t:nmatkul);
begin
t.atas:=0;
end;
procedure push (var
t:tumpukan;x:char);
begin
t.atas
:=t.atas+1;
t.isi [t.atas] :=x
end;
procedure pop
(var t:nmatkul);
begin
write(t.isi[t.atas]);
t.atas
:=t.atas-1;
end;
begin
clrscr;
awal
(t);
write(‘masukkan
jumlah mahasiswa:’);
readln(m);
for i:=1 to m do
with isi[i] do
begin
writeln(‘data
ke’,i);
write(‘masukkan
nim:’);
readln(nim);
write(‘masukkan
nama:’);
readln(nama);
write(‘masukkan
nilai:’);
readln(nilai);
writeln(‘============’);
end;
clrscr;
writeln(‘======data
yang telah dipop=====’);
for i:= 1 to m do
with isi[i] do
begin
writeln(data
ke’,i);
writeln(‘nim:’,nim);
writeln(‘nama:’,nama);
writeln(‘nilai:’,nilai);
writeln(‘==========’);
end;
readln
end.
Di bawah ini gambar codingnya di program pascal:
Berikut hasil outputnya: