Berikut ini source code nilai mahasiswa menggunakan compiler dev-pascal :
uses crt;
var
npm: string[7];
nama: string[25];
nilai_absen: real;
nilai_tugas: real;
nilai_uts: real;
nilai_uas: real;
nilai_akhir: real;
nilai_mutu: char;
nilai_IP: integer;
jumlah_nilai: integer;
lagi: char;
begin
clrscr;
lagi:='y';
while upcase(lagi)='Y' do
begin
clrscr;
gotoxy(32,2) ; write('DATA NILAI MAHASISWA');
gotoxy(3,3) ; write('___________________________________________________________________________');
gotoxy(27,5) ; write('NPM : '); readln(npm);
gotoxy(27,7) ; write('Nama Mahasiswa : '); readln(nama);
gotoxy(3,9) ; write('MK Pengantar Teknologi Informasi');
gotoxy(6,11) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,13) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,15) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,17) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,19) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,21) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,23) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,25) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,27) ; write('MK Bahasa Inggris');
gotoxy(6,29) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,31) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,33) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,35) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,37) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,39) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,41) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,43) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,45) ; write('MK Flowchart dan Alg. Pemrograman');
gotoxy(6,47) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,49) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,51) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,53) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,55) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 80 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,57) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,59) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,61) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,63) ; write('MK Akuntansi');
gotoxy(6,65) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,67) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,69) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,71) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,73) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 80 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 65 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,75) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,77) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,79) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,81) ; write('MK Aljabar. Vektor dan Matriks');
gotoxy(6,83) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,85) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,87) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,89) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,91) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,93) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,95) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,97) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,99) ; write('MK Pendidikan Pancasila');
gotoxy(6,101) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,103) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,105) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,107) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,109) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,111) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,113) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,115) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,117) ; write('MK Sistem Operasi');
gotoxy(6,119) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,121) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,123) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,125) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,127) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,129) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,131) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,133) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,135) ; write('MK Bahasa Pemrograman');
gotoxy(6,137) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,139) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,141) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,143) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(nilai_absen+2*nilai_tugas+3*nilai_uts+4*nilai_uas)/10;
gotoxy(6,145) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,147) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,149) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,151) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,153) ; write('MK Sistem Operasi');
gotoxy(6,155) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,157) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,159) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,161) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(2*nilai_absen+3*nilai_tugas+5*nilai_uas)/10;
gotoxy(6,163) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,165) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,167) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,169) ; write('Jumlah Nilai : ',jumlah_nilai);
gotoxy(3,171) ; write('MK Bahasa Pemrograman');
gotoxy(6,173) ; write('Nilai Absen : '); readln(nilai_absen);
gotoxy(6,175) ; write('Nilai Tugas : '); readln(nilai_tugas);
gotoxy(6,175) ; write('Nilai UTS : '); readln(nilai_uts);
gotoxy(6,179) ; write('Nilai UAS : '); readln(nilai_uas);
nilai_akhir:=(2*nilai_absen+3*nilai_tugas+5*nilai_uas)/10;
gotoxy(6,181) ; write('Nilai Akhir : ',nilai_akhir:1:0);
if nilai_akhir >= 85 then
begin
nilai_mutu:='A';
nilai_IP:=4;
end
else
if nilai_akhir > 70 then
begin
nilai_mutu:='B';
nilai_akhir:=3;
end
else
if nilai_akhir > 55 then
begin
nilai_mutu:='C';
nilai_IP:=2;
end
else
if nilai_akhir > 45 then
begin
nilai_mutu:='D';
nilai_IP:=1;
end
else
if nilai_akhir < 45 then
begin
nilai_mutu:='E';
nilai_IP:=0;
end;
gotoxy(6,183) ; write('Nilai Mutu : ',nilai_mutu);
gotoxy(6,185) ; write('Nilai IP : ',nilai_IP);
jumlah_nilai:=nilai_IP*2;
gotoxy(6,187) ; write('Jumlah Nilai : ',jumlah_nilai);
readln;
end;
end.