program RAPOR_SEMENTARA;
uses crt;
type
M = record
nmk,kode :array[1..10] of
string;
nl :array[1..10] of char;
sks,nilai :array[1..10] of
integer;
end;
var
w:M;
ftext : text;
nama,nim,prog
: string;
i,j,pl : byte;
total_sks,tn,total_nilai
: integer;
ip : real;
label menu;
begin
clrscr;
menu:
assign(ftext,'cetak isi KRS.doc');
rewrite(ftext);
gotoxy(5,1);writeln('--------------------------------------------------------------------');
gotoxy(21,2);writeln('
JURUSAN MATEMATIKA ');
gotoxy(17,3);writeln('FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM');
gotoxy(30,4);writeln('UNIVERSITAS HASANUDDIN');
gotoxy(5,5);writeln('--------------------------------------------------------------------');
writeln;
gotoxy(27,7);writeln('*KARTU HASIL STUDI SEMESTER*');
writeln;
gotoxy(5,9);write('SEMESTER : 2011/2');
gotoxy(50,9);write('PROG STUDI: ');readln(prog);
if prog
<>'' then
begin
gotoxy(5,10);write('Nama :
');readln(nama);
if nama
<>'' then
begin
gotoxy(5,11);write('NIM :
');readln(nim);
if nim
<>'' then
begin
gotoxy(5,12);writeln('====================================================================');
gotoxy(5,13);writeln('| NO | Kode
Mata Kuliah | nama mata kuliah |
sks | nilai |');
gotoxy(5,14);writeln('====================================================================');
i:=0;
total_sks:=0;
repeat
i:=i+1;
gotoxy(5,14+i);write('|',i);
gotoxy(10,14+i);write('|');
gotoxy(12,14+i);readln(w.kode[i]);
if(w.kode[i]) <>'' then
begin
gotoxy(31,14+i);write('|');
gotoxy(34,14+i);readln(w.nmk[i]);
gotoxy(56,14+i);write('|');
gotoxy(59,14+i);readln(w.sks[i]);
gotoxy(64,14+i);write('|');readln;
gotoxy(68,14+i);readln(w.nl[i]);
gotoxy(72,14+i);write('|');
total_sks:=total_sks+w.sks[i];
if
upcase(w.nl[i])='A' then
begin
w.nilai[i]:=4;
end
else
if
upcase(w.nl[i])='B' then
begin
w.nilai[i]:=3;
end
else
if
upcase(w.nl[i])='C'then
begin
w.nilai[i]:=2;
end
else
if
upcase(w.nl[i])='D'then
begin
w.nilai[i]:=1
end
else
w.nilai[i]:=0;
end;
tn:=0;
tn:=tn+w.nilai[i];
total_nilai:=0;
total_nilai:=total_nilai+(w.nilai[i]*w.sks[i]);
ip:=total_nilai/total_sks;
until
w.kode[i]='';
j:=i-1;
gotoxy(5,15+j);write('===================================================================');
gotoxy(5,15+j+1);write('Total Sks : ',total_sks);
gotoxy(5,15+j+2);write('total sks * nilai : ',total_nilai);
gotoxy(5,15+j+3);write('IP: ',ip);
gotoxy(5,15+j+4);write('=================================================================');
close(ftext);
end;
begin
gotoxy(5,15+j+5);writeln('1 :
CETAK KE FILE RAPOR.DOC');
gotoxy(5,15+j+6);writeln('2 :
Input Ulang');
gotoxy(5,15+j+7);writeln('3 :
EXIT');
gotoxy(5,15+j+8);write('pilihan: ');readln(pl);
case pl
of
1:
begin
assign(ftext,'cetak KRS.doc');
rewrite(ftext);
writeln(ftext,'=================================================================');
writeln(ftext,'
JURUSAN MATEMATIKA
');
writeln(ftext,' FAKULTAS
MATEMATIKA DAN ILMU PENGETAHUAN ALAM
');
writeln(ftext,'
UNIVERSITAS HASANUDDIN ');
writeln(ftext,'=================================================================');
writeln(ftext,' *
KARTU HASIL STUDI SEMESTER* ');
writeln(ftext,'');
writeln(ftext,'');
writeln(ftext,'SEMESTER :
2011/2 PROGRAM STUDI :
',prog );
writeln(ftext,'NAMA :
',nama);
writeln(ftext,'NIM : ',nim);
writeln(ftext,'');
writeln(ftext,'=================================================================');
writeln(ftext,'| No | KODE MATAKULIAH | NAMA MATAKULIAH | SKS | NILAI |');
writeln(ftext,'=================================================================');
i:=0;
REPEAT
i:=i+1;
if
w.kode[i] <>'' then
writeln(ftext,'|',i:4,'|',w.kode[i]:17,'|',w.nmk[i]:26,'|',w.sks[i]:5,'|',w.nilai[i],'|');
until
w.kode[i]='' ;
writeln(ftext,'===================================================================');
writeln(ftext,'');
writeln(ftext,'TOTAL SKS
: ',total_sks);
writeln(ftext,'TOTAL SKS * NILAI
: ',total_nilai);
writeln(ftext,'IP : ',ip:0:0);
writeln(ftext,'===================================================================');
close(ftext);
end;
2 :
goto
menu;
3 :
end;
end;
begin
writeln('DATA TELAH DICETAK');
readln;
end;
end;
end;
end.