Array membuat IPK
uses wincrt;
var
MK : Array [1..20] of String [20];
UAS,UTS,TM : Array [1..20] of Integer;
NA : Array [1..20] of Real;
NH : Array [1..20] of Char;
MT,SKS,BBT : Array [1..20] of Integer;
I,J,TMT,TKS,TBT : Integer;
IPK : Real;
Nama : String [15];
NIM : String [7];
Jur : String [2];
Procedure Spasi;
Begin
Writeln ('');
End;
Begin
TMT := 0;
TKS := 0;
Write ('Masukan Nama: '); Readln (Nama);
Write ('Masukan NIM: '); Readln (NIM);
Write ('Masukan Jurusan (SI/KA): '); Readln (Jur);
Write ('Mata Kuliah yg di ambil: '); Readln (J);
Clrscr;
For I := 1 to J do
Begin
clrscr;
Writeln ('Mata Kuliah Ke ',i);
Spasi;
Write ('Nama Mata Kuliah: '); Readln (MK[i]);
Write ('SKS Mata Kuliah: '); Readln (SKS[i]);
Write ('Nilai UTS: '); Readln (UTS[i]);
Write ('Nilai TM: '); Readln (TM[i]);
Write ('Nilai UAS: '); Readln (UAS[i]);
Spasi;
End;
For I := 1 to J do
Begin
NA[i] := 0.5 * UAS[i] + 0.3 * UTS[i] + 0.2 * TM[i];
End;
For I := 1 to J do
Begin
If (NA[i] <= 100) and (NA[i] >= 80) Then NH[i] := 'A'
Else If (NA[i] <= 79) and (NA[i] >= 70) Then NH[i] := 'B'
Else If (NA[i] <= 69) and (NA[i] >= 60) Then NH[i] := 'C'
Else If (NA[i] <= 59) and (NA[i] >= 50) Then NH[i] := 'D'
Else NH[i] := 'E';
End;
For I := 1 to J do
Begin
Case NH[i] of
'A' : MT[i] := 4;
'B' : MT[i] := 3;
'C' : MT[i] := 2;
'D' : MT[i] := 1;
'E' : MT[i] := 0;
End;
End;
For I := 1 to J do
Begin
TMT := TMT + MT[i];
TKS := TKS + SKS[i];
BBT[i] := MT[i] * SKS [i];
TBT := TBT + BBT[i];
End;
clrscr;
Writeln ('NAMA: ',Nama);
Writeln ('NOMOR INDUK MAHASISWA: ',NIM);
Writeln ('JURUSAN: ',Jur);
Spasi;
Writeln ('KARTU HASIL STUDI STMIK PUTERA BATAM');
Writeln ('=============================================================');
Writeln ('NO MATA KULIAH SKS UTS TM UAS NA NH MT BBT');
Writeln ('=============================================================');
For I:= 1 to J do
Begin
writeln (i,MK[i]:20,SKS[i]:5,UTS[i]:5,TM[i]:5,UAS[i]:5,NA[i]:5:0,
NH[i]:5,MT[i]:5,BBT[i]:5);
End;
Writeln ('==============================================================');
IPK := TBT / TKS;
Spasi;
Writeln ('Total SKS: ',TKS);
Writeln ('Total Mutu: ',TMT);
Writeln ('Total Bobot: ',TBT);
Writeln ('IPK: ',IPK:1:2);
End.
var
MK : Array [1..20] of String [20];
UAS,UTS,TM : Array [1..20] of Integer;
NA : Array [1..20] of Real;
NH : Array [1..20] of Char;
MT,SKS,BBT : Array [1..20] of Integer;
I,J,TMT,TKS,TBT : Integer;
IPK : Real;
Nama : String [15];
NIM : String [7];
Jur : String [2];
Procedure Spasi;
Begin
Writeln ('');
End;
Begin
TMT := 0;
TKS := 0;
Write ('Masukan Nama: '); Readln (Nama);
Write ('Masukan NIM: '); Readln (NIM);
Write ('Masukan Jurusan (SI/KA): '); Readln (Jur);
Write ('Mata Kuliah yg di ambil: '); Readln (J);
Clrscr;
For I := 1 to J do
Begin
clrscr;
Writeln ('Mata Kuliah Ke ',i);
Spasi;
Write ('Nama Mata Kuliah: '); Readln (MK[i]);
Write ('SKS Mata Kuliah: '); Readln (SKS[i]);
Write ('Nilai UTS: '); Readln (UTS[i]);
Write ('Nilai TM: '); Readln (TM[i]);
Write ('Nilai UAS: '); Readln (UAS[i]);
Spasi;
End;
For I := 1 to J do
Begin
NA[i] := 0.5 * UAS[i] + 0.3 * UTS[i] + 0.2 * TM[i];
End;
For I := 1 to J do
Begin
If (NA[i] <= 100) and (NA[i] >= 80) Then NH[i] := 'A'
Else If (NA[i] <= 79) and (NA[i] >= 70) Then NH[i] := 'B'
Else If (NA[i] <= 69) and (NA[i] >= 60) Then NH[i] := 'C'
Else If (NA[i] <= 59) and (NA[i] >= 50) Then NH[i] := 'D'
Else NH[i] := 'E';
End;
For I := 1 to J do
Begin
Case NH[i] of
'A' : MT[i] := 4;
'B' : MT[i] := 3;
'C' : MT[i] := 2;
'D' : MT[i] := 1;
'E' : MT[i] := 0;
End;
End;
For I := 1 to J do
Begin
TMT := TMT + MT[i];
TKS := TKS + SKS[i];
BBT[i] := MT[i] * SKS [i];
TBT := TBT + BBT[i];
End;
clrscr;
Writeln ('NAMA: ',Nama);
Writeln ('NOMOR INDUK MAHASISWA: ',NIM);
Writeln ('JURUSAN: ',Jur);
Spasi;
Writeln ('KARTU HASIL STUDI STMIK PUTERA BATAM');
Writeln ('=============================================================');
Writeln ('NO MATA KULIAH SKS UTS TM UAS NA NH MT BBT');
Writeln ('=============================================================');
For I:= 1 to J do
Begin
writeln (i,MK[i]:20,SKS[i]:5,UTS[i]:5,TM[i]:5,UAS[i]:5,NA[i]:5:0,
NH[i]:5,MT[i]:5,BBT[i]:5);
End;
Writeln ('==============================================================');
IPK := TBT / TKS;
Spasi;
Writeln ('Total SKS: ',TKS);
Writeln ('Total Mutu: ',TMT);
Writeln ('Total Bobot: ',TBT);
Writeln ('IPK: ',IPK:1:2);
End.
Tidak ada komentar:
Posting Komentar