Hayy sobattt.... Kali ini saya akan mempost Coding freepascal menghitung nilai IPK anda.... jika kamu belum mengambil KHS(KARTU HASIL STUDY) atau kamu ingin memprediksi nilai IPK kamu... cara nya gampang.. cukup kamu copas code dibawah ini pada program freepascal kamu...
langsung saja.. cekidoottt ....
Program Hit_IPK;
Uses crt;
const MaxMK = 150;
Type
{ Tabel Identitas Mahasiswa }
TblMK = ^IDMK;
IDMK = record
NamaMK : string[30];
SKS : integer;
Nilai : char;
BT : byte;
NextIDMK,
PrevIDMK : integer; { Posisi Record }
end;
Var
NIM : string[15];
NamaMhs : string[30];
DosenWali : string[30];
Jurusan : string[30];
i, n : byte;
DataMK : array [1..MaxMK] of TblMK;
JMK,NL,
IP,JBT,JSKS :Integer;
procedure InputID;
var ch : char;
begin
writeln('[1] Identitas Mahasiswa');
writeln('-----------------------');
write('NIM : ');readln(NIM);
write('Nama : ');readln(NamaMhs);
write('Jurusan : ');readln(Jurusan);
write('Dosen Wali : ');readln(DosenWali);
writeln;
write('Tekan sembarang tombol untuk melanjutkan...!');
ch := readkey;
end;
procedure InputMK;
var ch : char;
begin
clrscr;
writeln('[2] Nilai Mahasiswa');
writeln('-----------------------');
write('Jumlah MK : ');readln(n);
if (n > MaxMK) then
begin
write('Jumlah MK > ',MaxMK);
halt;
end
else
begin
for i:=1 to n do
begin
new(DataMK[i]);
writeln;
writeln('Mata Kuliah (MK) ke-',i);
writeln('-----------------------');
write('Nama MK : ');readln(DataMK[i]^.NamaMK);
write('Jml SKS : ');readln(DataMK[i]^.SKS);
write('Nilai (A/B/C/D/E) : ');readln(DataMK[i]^.Nilai);
with DataMK[i]^ do
begin
Nilai := upcase (Nilai);
case Nilai of
'A' :NL:=4;
'B' :NL:=3;
'C' :NL:=2;
'D' :NL:=1;
else NL:=0
end;
BT:=NL*SKS;
JSKS:=JSKS+SKS;
JBT:=JBT+BT;
end;
end;
end;
writeln;
write('Tekan sembarang tombol untuk melanjutkan...!');
ch := readkey;
end;
procedure ViewNilai;
var ch : char;
begin
clrscr;
writeln('[3] Tampilan Nilai');
writeln('-----------------------');
writeln('Hasil Perhitungan Indeks Prestasi (IP)');
writeln;
writeln('NIM : ',NIM);
writeln('Nama : ',NamaMhs);
writeln('Jurusan : ',Jurusan);
writeln('Dosen Wali : ',DosenWali);
writeln;
writeln('===================================================');
writeln(' No Mata Kuliah Jml SKS Nilai ');
writeln('===================================================');
for I:=1 to n do
begin
with DataMK[i]^ do
begin
Gotoxy (2,I+12);write(I:2);
Gotoxy (7,I+12);write(NamaMK);
Gotoxy (33,I+12);write(SKS);
Gotoxy (46,I+12);write(Nilai);
writeln;
end;
end;
writeln('---------------------------------------------------');
writeln('Jumlah Mata Kuliah = ',N);
writeln('Total SKS = ',JSKS);
writeln('Total Nilai = ',JBT);
writeln;
write('IP yang diperoleh = ',JBT/JSKS:0:3);
writeln;
writeln;
write('<< SELESAI >> Tekan sembarang tombol untuk melanjutkan...!');
ch := readkey;
end;
Begin { Program UTAMA }
clrscr;
writeln('------------------------------------');
writeln(' PROGRAM HITUNG IPK ');
writeln('------------------------------------');
writeln;writeln;
InputID;
InputMK;
ViewNilai;
End.
Oke... Sekian Semoga bermanfaat dan Nilai IPK kamu Bagus ...
Salaammm....
langsung saja.. cekidoottt ....
Program Hit_IPK;
Uses crt;
const MaxMK = 150;
Type
{ Tabel Identitas Mahasiswa }
TblMK = ^IDMK;
IDMK = record
NamaMK : string[30];
SKS : integer;
Nilai : char;
BT : byte;
NextIDMK,
PrevIDMK : integer; { Posisi Record }
end;
Var
NIM : string[15];
NamaMhs : string[30];
DosenWali : string[30];
Jurusan : string[30];
i, n : byte;
DataMK : array [1..MaxMK] of TblMK;
JMK,NL,
IP,JBT,JSKS :Integer;
procedure InputID;
var ch : char;
begin
writeln('[1] Identitas Mahasiswa');
writeln('-----------------------');
write('NIM : ');readln(NIM);
write('Nama : ');readln(NamaMhs);
write('Jurusan : ');readln(Jurusan);
write('Dosen Wali : ');readln(DosenWali);
writeln;
write('Tekan sembarang tombol untuk melanjutkan...!');
ch := readkey;
end;
procedure InputMK;
var ch : char;
begin
clrscr;
writeln('[2] Nilai Mahasiswa');
writeln('-----------------------');
write('Jumlah MK : ');readln(n);
if (n > MaxMK) then
begin
write('Jumlah MK > ',MaxMK);
halt;
end
else
begin
for i:=1 to n do
begin
new(DataMK[i]);
writeln;
writeln('Mata Kuliah (MK) ke-',i);
writeln('-----------------------');
write('Nama MK : ');readln(DataMK[i]^.NamaMK);
write('Jml SKS : ');readln(DataMK[i]^.SKS);
write('Nilai (A/B/C/D/E) : ');readln(DataMK[i]^.Nilai);
with DataMK[i]^ do
begin
Nilai := upcase (Nilai);
case Nilai of
'A' :NL:=4;
'B' :NL:=3;
'C' :NL:=2;
'D' :NL:=1;
else NL:=0
end;
BT:=NL*SKS;
JSKS:=JSKS+SKS;
JBT:=JBT+BT;
end;
end;
end;
writeln;
write('Tekan sembarang tombol untuk melanjutkan...!');
ch := readkey;
end;
procedure ViewNilai;
var ch : char;
begin
clrscr;
writeln('[3] Tampilan Nilai');
writeln('-----------------------');
writeln('Hasil Perhitungan Indeks Prestasi (IP)');
writeln;
writeln('NIM : ',NIM);
writeln('Nama : ',NamaMhs);
writeln('Jurusan : ',Jurusan);
writeln('Dosen Wali : ',DosenWali);
writeln;
writeln('===================================================');
writeln(' No Mata Kuliah Jml SKS Nilai ');
writeln('===================================================');
for I:=1 to n do
begin
with DataMK[i]^ do
begin
Gotoxy (2,I+12);write(I:2);
Gotoxy (7,I+12);write(NamaMK);
Gotoxy (33,I+12);write(SKS);
Gotoxy (46,I+12);write(Nilai);
writeln;
end;
end;
writeln('---------------------------------------------------');
writeln('Jumlah Mata Kuliah = ',N);
writeln('Total SKS = ',JSKS);
writeln('Total Nilai = ',JBT);
writeln;
write('IP yang diperoleh = ',JBT/JSKS:0:3);
writeln;
writeln;
write('<< SELESAI >> Tekan sembarang tombol untuk melanjutkan...!');
ch := readkey;
end;
Begin { Program UTAMA }
clrscr;
writeln('------------------------------------');
writeln(' PROGRAM HITUNG IPK ');
writeln('------------------------------------');
writeln;writeln;
InputID;
InputMK;
ViewNilai;
End.
Oke... Sekian Semoga bermanfaat dan Nilai IPK kamu Bagus ...
Salaammm....
Tidak ada komentar:
Posting Komentar