Assalamu'alaykum..
mau share program lagi nih.. kali ini program berbahasa pascal dengan fitur pointer dan record...
langsung aja cekidot..
uses crt;
type
nilai = ^mhsw;
mhsw = record
nm,nim,hrf : array [1..100] of string[70];
nalpro,nstrukdat,npemvis,max,min : array [1..100] of integer;
rta : array [1..100] of real;
end;
var
x : nilai ;
max,min : integer;
hrf : string;
i,n : integer;
begin
clrscr;
new (x);
with x^ do
begin
writeln(' PROGRAM PENDATAAN MAHASISWA ILMU KOMPUTER ');
writeln('=============================================');
writeln;
write ('JUMLAH MAHASISWA YANG INGIN DIDATA : ');readln(n);
for i:=1 to n do
begin
writeln('[' , i,'] INPUTKAN');
write (' NAMA : ');readln(nm[i]);
write (' NIM : ');readln(nim[i]);
write (' NILAI ALPRO II : ');readln(nalpro[i]);
write (' NILAI STRUKTUR DATA : ');readln(nstrukdat[i]);
write (' NILAI PEMROGRAMAN VISUAL : ');readln(npemvis[i]);
if nalpro[i] > nstrukdat[i] then
max[i]:=nalpro[i]
else max[i]:=nstrukdat[i];
if max[i] > npemvis[i] then
max[i]:=max[i]
else max[i]:=npemvis[i];
if nalpro[i] < nstrukdat[i] then
min[i]:=nalpro[i]
else min[i]:=nstrukdat[i];
if min[i] < npemvis[i] then
min[i]:=min[i]
else min[i]:=npemvis[i];
rta[i]:=(nalpro[i]+nstrukdat[i]+npemvis[i]) div 3;
writeln(' NILAI RATA-RATA : ',rta[i]:0:2);
if (rta[i] <= 50) then hrf[i]:='E'
else if (rta[i] <= 60) then hrf[i]:='D'
else if (rta[i] <= 70) then hrf[i]:='C'
else if (rta[i] <= 80) then hrf[i]:='B'
else hrf[i]:='A';
writeln(' AKREDITAS : ',hrf[i]);
readln;
end;
clrscr;
writeln;
writeln(' DATA NILAI MAHASISWA PRODI ILMU KOMPUTER ');
writeln('================================================================================');
writeln('NAMA | NIM | N.Alpro | N.StrukDat | N.PemVis | N.Max | N.Min | N.Rta | Akreditas');
writeln('================================================================================');
for i:=1 to n do
begin
writeln(nm[i],nim[i]:7,nalpro[i]:8,nstrukdat[i]:12,npemvis[i]:10,max[i]:10,min[i]:9,rta[i]:7:2,hrf[i]:9);
end;
writeln('================================================================================');
end; readln;
end.
dan ini kalo mau langsung download .pasnya (DISINI)
mau share program lagi nih.. kali ini program berbahasa pascal dengan fitur pointer dan record...
langsung aja cekidot..
uses crt;
type
nilai = ^mhsw;
mhsw = record
nm,nim,hrf : array [1..100] of string[70];
nalpro,nstrukdat,npemvis,max,min : array [1..100] of integer;
rta : array [1..100] of real;
end;
var
x : nilai ;
max,min : integer;
hrf : string;
i,n : integer;
begin
clrscr;
new (x);
with x^ do
begin
writeln(' PROGRAM PENDATAAN MAHASISWA ILMU KOMPUTER ');
writeln('=============================================');
writeln;
write ('JUMLAH MAHASISWA YANG INGIN DIDATA : ');readln(n);
for i:=1 to n do
begin
writeln('[' , i,'] INPUTKAN');
write (' NAMA : ');readln(nm[i]);
write (' NIM : ');readln(nim[i]);
write (' NILAI ALPRO II : ');readln(nalpro[i]);
write (' NILAI STRUKTUR DATA : ');readln(nstrukdat[i]);
write (' NILAI PEMROGRAMAN VISUAL : ');readln(npemvis[i]);
if nalpro[i] > nstrukdat[i] then
max[i]:=nalpro[i]
else max[i]:=nstrukdat[i];
if max[i] > npemvis[i] then
max[i]:=max[i]
else max[i]:=npemvis[i];
if nalpro[i] < nstrukdat[i] then
min[i]:=nalpro[i]
else min[i]:=nstrukdat[i];
if min[i] < npemvis[i] then
min[i]:=min[i]
else min[i]:=npemvis[i];
rta[i]:=(nalpro[i]+nstrukdat[i]+npemvis[i]) div 3;
writeln(' NILAI RATA-RATA : ',rta[i]:0:2);
if (rta[i] <= 50) then hrf[i]:='E'
else if (rta[i] <= 60) then hrf[i]:='D'
else if (rta[i] <= 70) then hrf[i]:='C'
else if (rta[i] <= 80) then hrf[i]:='B'
else hrf[i]:='A';
writeln(' AKREDITAS : ',hrf[i]);
readln;
end;
clrscr;
writeln;
writeln(' DATA NILAI MAHASISWA PRODI ILMU KOMPUTER ');
writeln('================================================================================');
writeln('NAMA | NIM | N.Alpro | N.StrukDat | N.PemVis | N.Max | N.Min | N.Rta | Akreditas');
writeln('================================================================================');
for i:=1 to n do
begin
writeln(nm[i],nim[i]:7,nalpro[i]:8,nstrukdat[i]:12,npemvis[i]:10,max[i]:10,min[i]:9,rta[i]:7:2,hrf[i]:9);
end;
writeln('================================================================================');
end; readln;
end.
dan ini kalo mau langsung download .pasnya (DISINI)
kalau ada pertanyaan langsung komen aja :)
wassalam..
0 Komentar untuk "Program pascal pointer nilai mahasiswa"
Bagaimana menurut Anda? Senang sekali jika Anda mau berbagi pendapat dengan saya disini. :)