Berikut adalah Source Code Program Pengolah Data Nilai Siswa Semi Lengkap dalam Bahasa Pascal.

Data arsip dari Die Coding, silakan digunakan dan diubah sesuka hati, semoga bermanfaat.

program tugas2;
uses crt;

type
	rsiswa = record
		nama    : string [30];
        absen   : string [5];
	end;

	rnilai = record
		ipa, mtk, ips, bind, hasil : real;
	end;
//deklarasi variabel
var siswa                               : array[1..100] of rsiswa;
	nilai								: array[1..100] of rnilai;
	total, rata, varians, deviasi, kkm  : array[1..4] of real;
	kesimpulan							: array[1..3] of shortint;
	i, j, n 							: shortint;
	pil        							: string [1];

	outplus, outmin		: array[1..4] of real;
	no					: array[1..4] of shortint;

//procedure identitas
procedure identitas;
begin
	clrscr;
	writeln(' ================================================== ');
	writeln('|                                                  |');
	writeln('|                   APLIKASI 2                     |');
	writeln('|           PROGRAM PENGOLAH NILAI SISWA           |');
	writeln('|                                                  |');
	writeln(' ================================================== ');
	writeln(' ');
	writeln(' ');
	writeln(' ========================================');
	writeln('|                                        |');
	writeln('|          source: diecoding.com         |');
	writeln('|                                        |');
	writeln(' ======================================== ');
	writeln(' ');
	write('Tekan enter untuk melanjutkan...'); readln;
end;

//procedure panduan
procedure panduan;
begin
    clrscr;
    writeln(' =================================================== ');
    writeln('|                                                   |');
    writeln('|________________PANDUAN_PENGGUNAAN_________________|');
    writeln('|                                                   |');
    writeln('| 1. PROGRAM INI HANYA UNTUK MENGHITUNG NILAI SISWA |');
    writeln('|    DENGAN MATA PELAJARAN IPA, MATEMATIKA, IPS DAN |');
    writeln('|    BAHASA INDONESIA.                              |');
    writeln('| 2. DAPAT MENGHITUNG NILAI TOTAL SETIAP SISWA.     |');
    writeln('| 3. DAPAT MENGOLAH RATA-RATA NILAI, STANDAR DEVIASI|');
    writeln('|    SETIAP MATA PELAJARAN.                         |');
    writeln('| 4. DAPAT MENENTUKAN SISWA YANG LULUS / TIDAK LULUS|');
    writeln('|    BERDASARKAN KKM YANG DITETAPKAN.               |');
    writeln('| 5. DAPAT MENENTUKAN SISWA YANG TERMASUK OUTLIER.  |');
    writeln('| 6. HANYA DAPAT DIGUNAKAN UNTUK MENGHITUNG 1-100   |');
    writeln('|    DATA SISWA.                                    |');
    writeln('|                                                   |');
    writeln(' =================================================== ');
    writeln(' ');
    write('Tekan enter untuk melanjutkan...'); readln;
end;

//procedure inputdata
procedure inputdata;
begin
clrscr;
write('Masukan jumlah siswa : ');
readln(n);

while (n<1) or (n> 100) do begin
	clrscr;
	write('Masukan jumlah siswa : ');
	writeln(' ');
	write(' !!!HANYA DAPAT MENGHITUNG 1-100 DATA SISWA!!!');
	readln(n);
end;

clrscr;
    writeln('              DATA AKAN DIANALISIS             ');
    writeln(' ');
    writeln;
    for i := 1 to n do begin
        writeln;
        writeln('  ============= ');
        write(' | DATA KE ');

        if i < 10 then
            writeln('  ', i, ' |')

        else if i < 100 then
            writeln(' ', i, ' |')

        else
            writeln(i, ' |');

        writeln('  ============= ');
        writeln;

        with siswa[i] do begin
            write(' Nama Lengkap           : '); readln(nama);
            write(' Nomor Absensi          : '); readln(absen);

        end;

        with nilai[i] do begin
            write(' Nilai IPA              : '); readln(ipa);
            while (ipa > 100) or (ipa < 0) do begin
                writeln;
                writeln('  =========================== ');
                writeln(' | !!! NILAI TIDAK VALID !!! |');
                writeln('  =========================== ');
                writeln;
                write(' Nilai IPA              : '); readln(ipa);
            end;

            write(' Nilai MATEMATIKA       : '); readln(mtk);
            while (mtk > 100) or (mtk < 0) do begin
                writeln;
                writeln('  =========================== ');
                writeln(' | !!! NILAI TIDAK VALID !!! |');
                writeln('  =========================== ');
                writeln;
                write(' Nilai MATEMATIKA       : '); readln(mtk);
            end;

            write(' Nilai IPS              : '); readln(ips);
            while (ips > 100) or (ips < 0) do begin
                writeln;
                writeln('  =========================== ');
                writeln(' | !!! NILAI TIDAK VALID !!! |');
                writeln('  =========================== ');
                writeln;
                write(' Nilai IPS              : '); readln(ips);
            end;

            write(' Nilai BAHASA INDONESIA : '); readln(bind);
            while (bind > 100) or (bind < 0) do begin
                writeln;
                writeln('  =========================== ');
                writeln(' | !!! NILAI TIDAK VALID !!! |');
                writeln('  =========================== ');
                writeln;
                write(' Nilai BAHASA INDONESIA : '); readln(bind);
            end;

            hasil := 0;
            hasil := ipa + mtk + ips + bind;

            writeln;
            writeln(' TOTAL NILAI : ', hasil:0:2);
        end;
    end;
end;

//function proses
function proses(): real;
begin
    clrscr;
    total[1]    := 0;
    total[2]    := 0;
    total[3]    := 0;
    total[4]    := 0;

    varians[1]  := 0;
    varians[2]  := 0;
    varians[3]  := 0;
    varians[4]  := 0;

    for i := 1 to n do
        with nilai[i] do begin
            total[1] := total[1] + ipa;
            total[2] := total[2] + mtk;
            total[3] := total[3] + ips;
            total[4] := total[4] + bind;
        end;

    rata[1]  := total[1] / n;
    rata[2]  := total[2] / n;
    rata[3]  := total[3] / n;
    rata[4]  := total[4] / n;

    for i := 1 to n do
        with nilai[i] do begin
            varians[1]  := varians[1] + (sqr(ipa  - rata[1]) / n);
            varians[2]  := varians[2] + (sqr(mtk - rata[2]) / n);
            varians[3]  := varians[3] + (sqr(ips  - rata[3]) / n);
            varians[4]  := varians[4] + (sqr(bind  - rata[4]) / n);
        end;

    deviasi[1]  := sqrt(varians[1]);
    deviasi[2]  := sqrt(varians[2]);
    deviasi[3]  := sqrt(varians[3]);
    deviasi[4]  := sqrt(varians[4]);
end;

//penetapan kkm
procedure inputkkm;
begin
    clrscr;
    writeln;
    writeln;
    writeln(' ==========================================');
    writeln;
    writeln(' SEMUA DATA BERHASIL DIMASUKKAN, MOHON     ');
    writeln(' TETAPKAN KKM UNTUK SETIAP MATA PELAJARAN :');
    writeln;
    write(' 1. IPA                 :  '); readln(kkm[1]);
    write(' 2. MATEMATIKA          :  '); readln(kkm[2]);
    write(' 3. IPS                 :  '); readln(kkm[3]);
    write(' 4. BAHASA INDONESIA    :  '); readln(kkm[4]);
    write('Tekan enter untuk melanjutkan...');
    readln;
end;

//function siswa yang lulus
function siswayanglulus(): real;
begin
clrscr;
writeln('  ========================================================= ');
writeln(' |                                                         |');
writeln(' |                    SISWA YANG LULUS                     |');
writeln(' |                                                         |');
writeln('  ========================================================= ');
writeln;

writeln('=======    NO__ABSENSI__NAMALENGKAP    =======');


kesimpulan[1] := 0;
for i := 1 to n do
    with nilai[i] do
        if (kkm[1] <= ipa) and (kkm[2] <= mtk) and (kkm[3] <= ips) and (kkm[4] <= bind) then begin
            inc(kesimpulan[1]);
            with siswa[i] do begin
                writeln('=======    ',kesimpulan[1],'__',absen,'__',nama,'  =======');
            end;

        end;

        if kesimpulan[1] = 0 then
            writeln('                          <kosong>');

            writeln;
            writeln;
            writeln;
            write(' Tekan ENTER untuk melanjutkan...'); readln;
end;

//function siswa yang tidak lulus
function siswayangtidaklulus(): real;
begin
clrscr;
writeln('  ========================================================= ');
writeln(' |                                                         |');
writeln(' |                 SISWA YANG TIDAK LULUS                  |');
writeln(' |                                                         |');
writeln('  ========================================================= ');
writeln;

writeln('=======    NO__ABSENSI__NAMALENGKAP    =======');

kesimpulan[2] := 0;
for i := 1 to n do
    with nilai[i] do
        if (kkm[1] > ipa) or (kkm[2] > mtk) or (kkm[3] > ips) or (kkm[4] > bind) then begin
            inc(kesimpulan[2]);
            with siswa[i] do begin
                writeln('=======    ',kesimpulan[2],'__',absen,'__',nama,'   =======');
            end;

        end;

        if kesimpulan[2] = 0 then
            writeln('                          <kosong>');

writeln;
writeln;
writeln;
write(' Tekan ENTER untuk melanjutkan...'); readln;
end;

//function outlier
function outlier(): real;
begin
    outplus[1] := rata[1] + (2 * deviasi[1]);
    outplus[2] := rata[2] + (2 * deviasi[2]);
    outplus[3] := rata[3] + (2 * deviasi[3]);
    outplus[4] := rata[4] + (2 * deviasi[4]);

    outmin[1]  := rata[1] - (2 * deviasi[1]);
    outmin[2]  := rata[2] - (2 * deviasi[2]);
    outmin[3]  := rata[3] - (2 * deviasi[3]);
    outmin[4]  := rata[4] - (2 * deviasi[4]);
end;

//function Data Outlier
function dataoutlier(): real;
begin
    clrscr;
    writeln('  ====================================================== ');
    writeln(' |                                                      |');
    writeln(' |                   DATA OUTLIER                       |');
    writeln(' |                                                      |');
    writeln('  ====================================================== ');
    writeln;

    writeln('                  ================== ');
    writeln('                 |       IPA        |');
    writeln('                  ================== ');
    writeln;
    writeln('=======    NO__ABSENSI__NAMALENGKAP    =======');

    no[1] := 0;
    for i := 1 to n do
        with nilai[i] do
            if (outplus[1] < ipa) or (outmin[1] > ipa) then begin
                inc(no[1]);
                with siswa[i] do begin
                    write('=======   ',no[1],'__',absen,'__',nama,'   =======');
                end;

            end;

            if no[1] = 0 then
                writeln('                       <kosong>');

    writeln;
    write(' Tekan ENTER untuk melanjutkan...'); readln;

    clrscr;
    writeln('  ====================================================== ');
    writeln(' |                                                      |');
    writeln(' |                   DATA OUTLIER                       |');
    writeln(' |                                                      |');
    writeln('  ====================================================== ');
    writeln;
    writeln('                  ================== ');
    writeln('                 |     MATEMATIKA   |');
    writeln('                  ================== ');
    writeln;
    writeln('=======    NO__ABSENSI__NAMALENGKAP    =======');

    no[2] := 0;
    for i := 1 to n do
        with nilai[i] do
            if (outplus[2] < mtk) or (outmin[2] > mtk) then begin
                inc(no[2]);
                with siswa[i] do begin
                    write('=======   ',no[2],'__',absen,'__',nama,'   =======');
                end;

            end;

            if no[2] = 0 then
                writeln('                       <kosong>');

    writeln;
    write(' Tekan ENTER untuk melanjutkan...'); readln;

    clrscr;
    writeln('  ====================================================== ');
    writeln(' |                                                      |');
    writeln(' |                   DATA OUTLIER                       |');
    writeln(' |                                                      |');
    writeln('  ====================================================== ');
    writeln;
    writeln('                  ================== ');
    writeln('                 |       IPS        |');
    writeln('                  ================== ');
    writeln;
    writeln('=======    NO__ABSENSI__NAMALENGKAP    =======');

    no[3] := 0;
    for i := 1 to n do
        with nilai[i] do
            if (outplus[3] < ips) or (outmin[3] > ips) then begin
                inc(no[3]);
                with siswa[i] do begin
                    write('=======   ',no[3],'__',absen,'__',nama,'   =======');
                end;

            end;

            if no[3] = 0 then
                writeln('                       <kosong>');

    writeln;
    write(' Tekan ENTER untuk melanjutkan...'); readln;

    clrscr;
    writeln('  ====================================================== ');
    writeln(' |                                                      |');
    writeln(' |                   DATA OUTLIER                       |');
    writeln(' |                                                      |');
    writeln('  ====================================================== ');
    writeln;
    writeln('                  ================== ');
    writeln('                 | BAHASA INDONESIA |');
    writeln('                  ================== ');
    writeln;
    writeln('=======    NO__ABSENSI__NAMALENGKAP    =======');

    no[4] := 0;
    for i := 1 to n do
        with nilai[i] do
            if (outplus[4] < bind) or (outmin[4] > bind) then begin
                inc(no[4]);
                with siswa[i] do begin
                    write('=======   ',no[4],'__',absen,'__',nama,'   =======');
                end;

            end;

            if no[4] = 0 then
                writeln('                       <kosong>');

    kesimpulan[3] := no[1] + no[2] + no[3] + no[4];

    writeln;
    writeln;
    writeln;
    write(' Tekan ENTER untuk melanjutkan...'); readln;
end;

//procedure output keseluruhan
procedure outputkeseluruhan;
begin
    clrscr;
    writeln(' =================================================');
    writeln('                                                  ');
    writeln('    RATA - RATA NILAI SETIAP MATA PELAJARAN :     ');
    writeln('    1. IPA                 :',rata[1]:0:2          );
    writeln('    2. MATEMATIKA          :',rata[2]:0:2          );
    writeln('    3. IPS                 :',rata[3]:0:2          );
    writeln('    4. BAHASA INDONESIA    :',rata[4]:0:2          );
    writeln('                                                  ');
    writeln('    STANDAR DEVIASI SETIAP MATA PELAJARAN :       ');
    writeln('    1. IPA                 :',deviasi[1]:0:2       );
    writeln('    2. MATEMATIKA          :',deviasi[2]:0:2       );
    writeln('    3. IPS                 :',deviasi[3]:0:2       );
    writeln('    4. BAHASA INDONESIA    :',deviasi[4]:0:2       );
    writeln;
    write(' Tekan ENTER untuk melanjutkan...'); readln;

    clrscr;
    writeln(' =================================================');
    writeln('                                                  ');
    writeln('    KKM SETIAP MATA PELAJARAN :                   ');
    writeln('    1. IPA                 :',kkm[1]:0:2           );
    writeln('    2. MATEMATIKA          :',kkm[2]:0:2           );
    writeln('    3. IPS                 :',kkm[3]:0:2           );
    writeln('    4. BAHASA INDONESIA    :',kkm[4]:0:2           );
    writeln('                                                  ');
    writeln('    KESIMPULAN :                                  ');
    writeln('    1. SISWA KESELURUHAN   :',n                    );
    writeln('    2. LULUS               :',kesimpulan[1]        );
    writeln('    3. TIDAK LULUS         :',kesimpulan[2]        );
    writeln('    4. OUTLIER             :',kesimpulan[3]        );
    writeln('       a. IPA              :',no[1]                );
    writeln('       b. MATEMATIKA       :',no[2]                );
    writeln('       c. IPS              :',no[3]                );
    writeln('       d. BAHASA INDONESIA :',no[4]                );
    writeln('                                                  ');
    writeln(' ================mbbb=================================');
    write(' Tekan ENTER untuk melanjutkan...'); readln;
end;

//procedure penutup
procedure penutup;
begin
    clrscr;
    writeln('Terimakasih telah menggunakan aplikasi ini...');
    writeln;
end;


//program utama
begin
    identitas;
    panduan;
    repeat
        inputdata;
        inputkkm;
        proses;
        siswayanglulus;
        siswayangtidaklulus;
        outlier;
        dataoutlier;
        outputkeseluruhan;
        //konfirmasi pengulangan program
        writeln;
        writeln;
        writeln;
        writeln('y untuk memasukan kembali data yang akan dianalisis');
        writeln('n untuk menutup aplikasi ini');
        write('Lanjut? y|n : '); readln(pil);
    until (pil = 'n') or (pil = 'N');
    penutup;
readkey;
end.