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

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

program aplikasi2;
uses crt;

type
    // deklarasikan type data record siswa
    rsiswa = record
        absen: string[10];
        nama : string[30];
    end;

    // deklarasikan type data record nilai
    rnilai = record
        ipa, mate, ips, bin, hasil : real;
    end;

// deklarasikan 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, n                              : shortint;
    pil1, pil2, pil3                  : string[1];

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

// program utama
begin
    clrscr; // bersihkan layar saat program dijalankan

    // [BEGIN] identitas program 
    writeln('  ------------------------------------------------- ');
    writeln(' |                                                 |');    
    writeln(' |                   APLIKASI 2                    |');
    writeln(' |          PROGRAM PENGOLAH NILAI SISWA           |');
    writeln(' |   ( IPA, MATEMATIKA, IPS, BAHASA INDONESIA )    |');
    writeln(' |                                                 |');
    writeln('  ------------------------------------------------- ');
    writeln('  ------------------------------------------------- ');
    writeln(' |                                                 |');    
    writeln(' |              source: diecoding.com              |');
    writeln(' |                                                 |');
    writeln('  ------------------------------------------------- ');
    writeln;
    writeln;
    writeln;
    // [END] identitas program

    // portal pilihan ke panduan
    write(' Baca panduan penggunaan? y|n : '); readln(pil1);

    // pengisian pilihan tidak sesuai yang dianjurkan
    while (lowercase(pil1) <> 'n') and (lowercase(pil1) <> 'y') do begin
        write(' Baca panduan penggunaan? y|n : '); readln(pil1);
    end;

    // jika pilihan terisi Y atau y
    if lowercase(pil1) = 'y' then begin
        clrscr;
        writeln('  ------------------------------------------------- ');
        writeln(' |                                                 |');    
        writeln(' |               PANDUAN PENGGUNAAN                |');
        writeln(' |          PROGRAM PENGOLAH NILAI SISWA           |');
        writeln(' |                                                 |');
        writeln('  ------------------------------------------------- ');
        writeln('  ------------------------------------------------- ');
        writeln(' |                                                 |');
        writeln(' | 1. PROGRAM INI HANYA UNTUK MENGHITUNG NILAI     |');
        writeln(' |    SISWA DENGAN MATA PELAJARAN IPA, MATEMATIKA, |');
        writeln(' |    IPS, BAHASA INDONESIA.                       |');
        writeln(' | 2. DAPAT MENGHITUNG NILAI TOTAL SETIAP SISWA.   |');
        writeln(' | 3. DAPAT MENGOLAH RATA-RATA NILAI, STANDAR      |');
        writeln(' |    DEVIASI SETIAP MATA PELAJARAN.               |');
        writeln(' | 4. BERDASAR KKM YANG TELAH DITETAPKAN, PROGRAM  |');
        writeln(' |    DAPAT MENENTUKAN SISWA YANG LULUS / TIDAK    |');
        writeln(' |    LULUS.                                       |');
        writeln(' | 5. MENENTUKAN SISWA YANG TERMASUK OUTLIER.      |');
        writeln(' | 6. UNTUK BILANGAN DESIMAL GUNAKAN TANDA TITIK   |');
        writeln(' |    (.) SEBAGAI PEMISAH.                         |');
        writeln(' | 7. HANYA DAPAT DIGUNAKAN UNTUK MENGHITUNG       |');
        writeln(' |    1 - 100 DATA SISWA.                          |');
        writeln(' |                                                 |');
        writeln('  ------------------------------------------------- ');
        writeln;

        writeln(' Tekan [ ENTER ] untuk melanjutkan atau   --------- ');
        writeln(' [ Q kemudian ENTER ] untuk keluar       |         |');
        writeln(' program !                                --------- ');

        gotoxy(47, 27);
        readln(pil2);
    end;

    // jika pada portal pilihan terisi N atau pada bagian akhir dari panduan tidak terisi Q
    if (lowercase(pil1) = 'n') or (lowercase(pil2) <> 'q') then begin

        // [BEGIN] program inti
        repeat
            clrscr;
            writeln('                                               ------- ');
            writeln('MASUKKAN JUMLAH SISWA YANG AKAN DIANALISIS :  |       |');            
            writeln('                                               ------- ');

            gotoxy(50, 2);
            readln(n);

            // jika nilai (n) yang dimasukkan tidak memenuhi (bukan 1 - 100)
            while (n < 1) or (n > 100) do begin
                clrscr;
                writeln('                                               ------- ');
                writeln('MASUKKAN JUMLAH SISWA YANG AKAN DIANALISIS :  |       |');            
                writeln('                                               ------- ');
                writeln;
                writeln('  ---------------------------- ');
                writeln(' | !!! HANYA 1 - 100 DATA !!! |');
                writeln('  ---------------------------- ');
                
                gotoxy(50, 2);
                readln(n);
            end;

            clrscr;
            writeln('  ------------------------------------------------- ');
            writeln(' |                                                 |');
            writeln(' |                DATA AKAN DIANALISIS             |');
            writeln(' |                                                 |');
            writeln('  ------------------------------------------------- ');

            gotoxy(15,3); write(n);
            writeln;
            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(' Nomor Absensi          : '); readln(absen);
                    write(' Nama Lengkap           : '); readln(nama);

                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(mate);
                    while (mate > 100) or (mate < 0) do begin
                        writeln;
                        writeln('  --------------------------- ');
                        writeln(' | !!! NILAI TIDAK VALID !!! |');
                        writeln('  --------------------------- ');
                        writeln;
                        write(' Nilai MATEMATIKA       : '); readln(mate);
                    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(bin);
                    while (bin > 100) or (bin < 0) do begin
                        writeln;
                        writeln('  --------------------------- ');
                        writeln(' | !!! NILAI TIDAK VALID !!! |');
                        writeln('  --------------------------- ');
                        writeln;
                        write(' Nilai BAHASA INDONESIA : '); readln(bin);
                    end;

                    hasil := 0;
                    hasil := ipa + mate + ips + bin;

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

            // menghitung rata-rata, deviasi
            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] + mate;
                    total[3] := total[3] + ips;
                    total[4] := total[4] + bin;
                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(mate - rata[2]) / n);
                    varians[3]  := varians[3] + (sqr(ips  - rata[3]) / n);
                    varians[4]  := varians[4] + (sqr(bin  - rata[4]) / n);
                end;

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

            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]);

            // menampilkan data input
            clrscr;
            writeln('  ------------------------------------------------- ');
            writeln(' |                                                 |');
            writeln(' |   RATA - RATA NILAI SETIAP MATA PELAJARAN :     |');
            writeln(' |   1. IPA                 :                      |');
            writeln(' |   2. MATEMATIKA          :                      |');
            writeln(' |   3. IPS                 :                      |');
            writeln(' |   4. BAHASA INDONESIA    :                      |');
            writeln(' |                                                 |');
            writeln(' |   STANDAR DEVIASI SETIAP MATA PELAJARAN :       |');
            writeln(' |   1. IPA                 :                      |');
            writeln(' |   2. MATEMATIKA          :                      |');
            writeln(' |   3. IPS                 :                      |');
            writeln(' |   4. BAHASA INDONESIA    :                      |');
            writeln(' |                                                 |');
            writeln(' |   KKM SETIAP MATA PELAJARAN :                   |');
            writeln(' |   1. IPA                 :                      |');
            writeln(' |   2. MATEMATIKA          :                      |');
            writeln(' |   3. IPS                 :                      |');
            writeln(' |   4. BAHASA INDONESIA    :                      |');
            writeln(' |                                                 |');
            writeln('  ------------------------------------------------- ');
            gotoxy(31,4);
            writeln(rata[1]:0:2);
            gotoxy(31,5);
            writeln(rata[2]:0:2);
            gotoxy(31,6);
            writeln(rata[3]:0:2);
            gotoxy(31,7);
            writeln(rata[4]:0:2);

            gotoxy(31,10);
            writeln(deviasi[1]:0:2);
            gotoxy(31,11);
            writeln(deviasi[2]:0:2);
            gotoxy(31,12);
            writeln(deviasi[3]:0:2);
            gotoxy(31,13);
            writeln(deviasi[4]:0:2);

            gotoxy(31,16);
            writeln(kkm[1]:0:2);
            gotoxy(31,17);
            writeln(kkm[2]:0:2);
            gotoxy(31,18);
            writeln(kkm[3]:0:2);
            gotoxy(31,19);
            writeln(kkm[4]:0:2);

            gotoxy(2,23);
            write(' Tekan ENTER untuk melanjutkan...'); readln;

            // menampilkan siswa lulus
            clrscr;
            writeln('  --------------------------------------------------------- ');
            writeln(' |                                                         |');
            writeln(' |                    SISWA YANG LULUS                     |');
            writeln(' |                                                         |');
            writeln('  --------------------------------------------------------- ');
            writeln;

            writeln(' NO.  ABSENSI     NAMA LENGKAP                   TOTAL NILAI');

            kesimpulan[1] := 0;
            for i := 1 to n do
                with nilai[i] do
                    if (kkm[1] <= ipa) and (kkm[2] <= mate) and (kkm[3] <= ips) and (kkm[4] <= bin) then begin
                        inc(kesimpulan[1]);
                        with siswa[i] do begin
                            write(' ', kesimpulan[1], '.');
                            gotoxy(7, kesimpulan[1] + 7);
                            write(absen);
                            gotoxy(19, kesimpulan[1] + 7);
                            write(nama);
                        end;

                        with nilai[i] do
                            gotoxy(50, kesimpulan[1] + 7);
                            writeln(hasil:0:2);
                    end;

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

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

            // menampilkan siswa tidak lulus
            clrscr;
            writeln('  --------------------------------------------------------- ');
            writeln(' |                                                         |');
            writeln(' |                 SISWA YANG TIDAK LULUS                  |');
            writeln(' |                                                         |');
            writeln('  --------------------------------------------------------- ');
            writeln;

            writeln(' NO.  ABSENSI     NAMA LENGKAP                   TOTAL NILAI');

            kesimpulan[2] := 0;
            for i := 1 to n do
                with nilai[i] do
                    if (kkm[1] > ipa) or (kkm[2] > mate) or (kkm[3] > ips) or (kkm[4] > bin) then begin
                        inc(kesimpulan[2]);
                        with siswa[i] do begin
                            write(' ', kesimpulan[2], '.');
                            gotoxy(7, kesimpulan[2] + 7);
                            write(absen);
                            gotoxy(19, kesimpulan[2] + 7);
                            write(nama);
                        end;

                        with nilai[i] do
                            gotoxy(50, kesimpulan[2] + 7);
                            writeln(hasil:0:2);
                    end;

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

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

            // menampilkan siswa outlier ipa
            clrscr;
            writeln('  ------------------------------------------------------ ');
            writeln(' |                                                      |');
            writeln(' |                   DATA OUTLIER                       |');
            writeln(' |                                                      |');
            writeln('  ------------------------------------------------------ ');
            writeln;

            // menganalisis data outlier
            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]);

            writeln('                  ------------------ ');
            writeln('                 |       IPA        |');
            writeln('                  ------------------ ');
            writeln;
            writeln(' NO.  ABSENSI     NAMA LENGKAP                   NILAI');

            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], '.');
                            gotoxy(7, no[1] + 11);
                            write(absen);
                            gotoxy(19, no[1] + 11);
                            write(nama);
                        end;

                        with nilai[i] do
                            gotoxy(50, no[1] + 11);
                            writeln(ipa:0:2);
                    end;

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

            writeln;
            writeln;
            writeln('                  ------------------ ');
            writeln('                 |    MATEMATIKA    |');
            writeln('                  ------------------ ');
            writeln;
            writeln(' NO.  ABSENSI     NAMA LENGKAP                   NILAI');

            no[2] := 0;
            for i := 1 to n do
                with nilai[i] do
                    if (outplus[2] < mate) or (outmin[2] > mate) then begin
                        inc(no[2]);
                        with siswa[i] do begin
                            write(' ', no[2], '.');
                            gotoxy(7, no[2] + no[1] + 18);
                            write(absen);
                            gotoxy(19, no[2] + no[1] + 18);
                            write(nama);
                        end;

                        with nilai[i] do
                            gotoxy(50, no[2] + no[1] + 18);
                            writeln(mate:0:2);
                    end;

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

            writeln;
            writeln;
            writeln('                  ------------------ ');
            writeln('                 |       IPS        |');
            writeln('                  ------------------ ');
            writeln;
            writeln(' NO.  ABSENSI     NAMA LENGKAP                   NILAI');

            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[2], '.');
                            gotoxy(7, no[3] + no[2] + no[1] + 25);
                            write(absen);
                            gotoxy(19, no[3] + no[2] + no[1] + 25);
                            write(nama);
                        end;

                        with nilai[i] do
                            gotoxy(50, no[3] + no[2] + no[1] + 25);
                            writeln(ips:0:2);
                    end;

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

            writeln;
            writeln;
            writeln('                  ------------------ ');
            writeln('                 | BAHASA INDONESIA |');
            writeln('                  ------------------ ');
            writeln;
            writeln(' NO.  ABSENSI     NAMA LENGKAP                   NILAI');

            no[4] := 0;
            for i := 1 to n do
                with nilai[i] do
                    if (outplus[4] < bin) or (outmin[4] > bin) then begin
                        inc(no[4]);
                        with siswa[i] do begin
                            write(' ', no[4], '.');
                            gotoxy(7, no[4] + no[3] + no[2] + no[1] + 32);
                            write(absen);
                            gotoxy(19, no[4] + no[3] + no[2] + no[1] + 32);
                            write(nama);
                        end;

                        with nilai[i] do
                            gotoxy(50, no[4] + no[3] + no[2] + no[1] + 32);
                            writeln(bin:0:2);
                    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;
            
            // tampilkan data akhir
            clrscr;
            writeln('  ------------------------------------------------- ');
            writeln(' |                                                 |');
            writeln(' |   RATA - RATA NILAI SETIAP MATA PELAJARAN :     |');
            writeln(' |   1. IPA                 :                      |');
            writeln(' |   2. MATEMATIKA          :                      |');
            writeln(' |   3. IPS                 :                      |');
            writeln(' |   4. BAHASA INDONESIA    :                      |');
            writeln(' |                                                 |');
            writeln(' |   STANDAR DEVIASI SETIAP MATA PELAJARAN :       |');
            writeln(' |   1. IPA                 :                      |');
            writeln(' |   2. MATEMATIKA          :                      |');
            writeln(' |   3. IPS                 :                      |');
            writeln(' |   4. BAHASA INDONESIA    :                      |');
            writeln(' |                                                 |');
            writeln(' |   KKM SETIAP MATA PELAJARAN :                   |');
            writeln(' |   1. IPA                 :                      |');
            writeln(' |   2. MATEMATIKA          :                      |');
            writeln(' |   3. IPS                 :                      |');
            writeln(' |   4. BAHASA INDONESIA    :                      |');
            writeln(' |                                                 |');
            writeln(' |   KESIMPULAN :                                  |');
            writeln(' |   1. SISWA KESELURUHAN   :                      |');
            writeln(' |   2. LULUS               :                      |');
            writeln(' |   3. TIDAK LULUS         :                      |');
            writeln(' |   4. OUTLIER             :                      |');
            writeln(' |      a. IPA              :                      |');
            writeln(' |      b. MATEMATIKA       :                      |');
            writeln(' |      c. IPS              :                      |');
            writeln(' |      d. BAHASA INDONESIA :                      |');
            writeln(' |                                                 |');
            writeln('  ------------------------------------------------- ');
            gotoxy(31,4);
            writeln(rata[1]:0:2);
            gotoxy(31,5);
            writeln(rata[2]:0:2);
            gotoxy(31,6);
            writeln(rata[3]:0:2);
            gotoxy(31,7);
            writeln(rata[4]:0:2);

            gotoxy(31,10);
            writeln(deviasi[1]:0:2);
            gotoxy(31,11);
            writeln(deviasi[2]:0:2);
            gotoxy(31,12);
            writeln(deviasi[3]:0:2);
            gotoxy(31,13);
            writeln(deviasi[4]:0:2);

            gotoxy(31,16);
            writeln(kkm[1]:0:2);
            gotoxy(31,17);
            writeln(kkm[2]:0:2);
            gotoxy(31,18);
            writeln(kkm[3]:0:2);
            gotoxy(31,19);
            writeln(kkm[4]:0:2);

            gotoxy(31,22);
            writeln(n);
            gotoxy(31,23);
            writeln(kesimpulan[1]);
            gotoxy(31,24);
            writeln(kesimpulan[2]);
            gotoxy(31,25);
            writeln(kesimpulan[3]);
            gotoxy(31,26);
            writeln(no[1]);
            gotoxy(31,27);
            writeln(no[2]);
            gotoxy(31,28);
            writeln(no[3]);
            gotoxy(31,29);
            writeln(no[4]);

            // konfirmasi pengulangan program
            writeln;
            writeln;
            writeln;
            writeln;
            write(' Ingin mencoba lagi? y|n : ');  readln(pil3);

            // jika pilihan konfirmasi tidak terisi sesuai anjuran
            while (lowercase(pil3) <> 'n') and (lowercase(pil3) <> 'y') do begin
                write(' Ingin mencoba lagi? y|n : '); readln(pil3);
            end;

        until lowercase(pil3) = 'n';
        // [END] program inti
    end;

    // penutup
    clrscr;
    writeln('  ------------------------------------------------- ');
    writeln(' |                                                 |');    
    writeln(' |         TERIMA KASIH TELAH MENGGUNAKAN          |');
    writeln(' |        PROGRAM PENGOLAH NILAI SISWA KAMI        |');
    writeln(' |                                                 |');
    writeln('  ------------------------------------------------- ');
    write(' '); readkey;
end.