Source Code Program Pascal Transkip Nilai Mahasiswa Sederhana
Created By Lukman Wahyudi ( Lucky Apocalypse )
Source Code Program Transkip Nilai Mahasiswa dalam Pascal Created By Lukman Wahyudi
2009
Source Code
program transkip_nilai; uses wincrt; type siswa = record Nama : String[100]; NRP : String[12]; krs : array[1..12,1..12] of String[23]; krs2 : array[1..12,1..12] of Integer; end; type kuliah = array[1..12] of siswa; var N, M, k, i: Integer; kul : kuliah;
function Huruf(bobot : Integer) : char; begin case bobot of 0 : huruf := 'E'; 1 : huruf := 'D'; 2 : huruf := 'C'; 3 : huruf := 'B'; 4 : huruf := 'A'; end; end;
1
Source Code Program Transkip Nilai Mahasiswa dalam Pascal Created By Lukman Wahyudi
2009
function Bobot(nilai : integer) : integer; begin if nilai < 40 then bobot := 0 else if ( nilai >= 40 ) and ( nilai < 55 ) then bobot := 1 else if ( nilai >= 55 ) and ( nilai < 65 ) then bobot := 2 else if ( nilai >= 65 ) and ( nilai < 76 ) then bobot := 3 else bobot := 4; end;
procedure masukkan_data(var kul:kuliah; var N, M : integer); var k, i : Integer; begin write('Banyak Mahasiswa : '); readln(N); write('Banyak Mata Kuliah : '); readln(M); writeln; for k := 1 to N do begin write('Nama Mahasiswa : '); readln(kul[k].Nama); write('NRP Mahasiswa : '); readln(kul[k].NRP); writeln;
2
Source Code Program Transkip Nilai Mahasiswa dalam Pascal Created By Lukman Wahyudi
2009
for i := 1 to M do begin write('Kode Mata Kuliah : '); readln(kul[k].krs[1,i]); write('Nama Mata Kulia : '); readln(kul[k].krs[2,i]); write('Jumlah SKS Mata Kuliah : '); readln(kul[k].krs2[3,i]); write('Nilai Mata Kuliah : '); readln(kul[k].krs2[4,i]); writeln('Bobot : ', bobot(kul[k].krs2[4,i])); writeln('Range Nilai : ',huruf(bobot(kul[k].krs2[4,i]))); kul[k].krs2[5,i] := (bobot(kul[k].krs2[4,i])); writeln; end; end; end;
procedure Hasil; var k, i : integer; jmlsks, total : integer; IP : real; begin Writeln; writeln('Hasil KRS':40);
3
Source Code Program Transkip Nilai Mahasiswa dalam Pascal Created By Lukman Wahyudi
2009
writeln; writeln; for k:= 1 to N do begin writeln('Nama Mahasiswa : ',kul[k].Nama); writeln('NRP Mahasiswa : ',kul[k].NRP); writeln; writeln('=============================================================== =========='); writeln('| No | Kode MK |
Nama MK
| SKS | Nilai | Rata - Rata |');
writeln('------------------------------------------------------------------------- '); jmlsks := 0; total := 0; for i := 1 to M do begin write('| ', i:2, '|':2, kul[k].krs[1,i]:8, '|':2, kul[k].krs[2,i]:27,'|':2, kul[k].krs2[3,i]:3, '|':3, huruf(bobot(kul[k].krs2[4,i])):4, '|':4, kul[k].krs2[3,i]*bobot(kul[k].krs2[4,i]):7, '|':7); writeln; jmlsks := jmlsks + kul[k].krs2[3,i]; total := total + kul[k].krs2[3,i]*kul[k].krs2[5,i]; end; writeln('------------------------------------------------------------------------- '); writeln('|
Total
|', jmlsks:3, '|':3, '|':8, Total:7, '|':7);
writeln('=================================================== ==============='); Writeln; 4
Source Code Program Transkip Nilai Mahasiswa dalam Pascal Created By Lukman Wahyudi
2009
writeln; if jmlsks <> 0 then IP := total / jmlsks; writeln('IP = ',IP:0:2); writeln; end; readkey; end;
(*Program Inti*) begin GotoXY(20,10); writeln('Selamat Datang di Program KRS Mahasiswa'); GotoXY(20,12); writeln; GotoXY(20,13); writeln; GotoXY(24,14); Writeln('Press any key to continue........'); readkey; clrscr; writeln; masukkan_data(kul,N,M); writeln('Press any key to show the result.................'); readkey; clrscr; Hasil; end.
5