Senin, 28 Februari 2011

JAWABAN UH PASCAL (PROGRAM GAJI)


Berikut Sciptnya :


PROGRAM GAJI_PEGAWAI;
USES CRT;
VAR NO : INTEGER;
    NAMA : STRING [30];
    JABATAN : INTEGER;
    GOLONGAN : STRING;
    GAPOK : REAL;
    BONUS : REAL;
    GATOT : REAL;

BEGIN
     CLRSCR;
     GOTOXY (1,1); WRITELN ('Program Created By : Ryan Eka Putra Wijaya (X-RPL2 / 20)');
     GOTOXY (14,3) ; WRITELN ('GAJI PEGAWAI');
     GOTOXY (8,4) ; WRITELN ('PERUSAHAAN ARPELLOW-GAZ');
     GOTOXY (4,5); WRITELN ('-------------------------------');

     GOTOXY (4,6); WRITE ('Masukkan No Pegawai Anda: '); READLN (NO);
     GOTOXY (4,7); WRITE ('Masukkan Nama Anda: '); READLN (NAMA);
     GOTOXY (4,8); WRITE ('Masukkan Gaji Pokok Anda: '); READLN (GAPOK);
     GOTOXY (4,9); WRITE ('Masukkan Kode Jabatan: '); READLN (JABATAN);


     IF JABATAN = 1 THEN
     BEGIN
     GOTOXY (4,11); WRITELN ('Nama Anda: ', NAMA);
     GOTOXY (4,12); WRITELN ('Jabatan: DIREKTUR');
     BONUS := 0.25*GAPOK;
     GATOT := BONUS+GAPOK;
     GOTOXY (4,13); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
     GOTOXY (4,14); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
     END;

     IF JABATAN = 2 THEN
     BEGIN
     GOTOXY (4,11); WRITELN ('Nama Anda: ', NAMA);
     GOTOXY (4,12); WRITELN ('Jabatan: WAKIL DIREKTUR');
     BONUS := 0.25*GAPOK;
     GATOT := BONUS+GAPOK;
     GOTOXY (4,13); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
     GOTOXY (4,14); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
     END;

     IF JABATAN = 3 THEN
     BEGIN
     GOTOXY (4,11); WRITELN ('Nama Anda: ', NAMA);
     GOTOXY (4,12); WRITELN ('Jabatan: KEPALA BAGIAN');
     BONUS := 0.25*GAPOK;
     GATOT := BONUS+GAPOK;
     GOTOXY (4,13); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
     GOTOXY (4,14); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
     END;

     IF JABATAN = 4 THEN
     BEGIN
     GOTOXY (4,11); WRITELN ('Nama Anda: ', NAMA);
     GOTOXY (4,12); WRITELN ('Jabatan: KEPALA SEKSI');
     BONUS := 1*GAPOK;
     GATOT := BONUS+GAPOK;
     GOTOXY (4,13); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
     GOTOXY (4,14); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
     END;

     IF JABATAN = 5 THEN
     BEGIN
     GOTOXY (4,10); WRITE ('Masukkan Golongan Anda: '); READLN (GOLONGAN);
     GOTOXY (4,12); WRITELN ('Nama Anda: ', NAMA);
     GOTOXY (4,13); WRITELN ('Jabatan: STAF');
     GOTOXY (21,13); WRITELN ('Golongan: ', GOLONGAN);

            IF (GOLONGAN = 'A') THEN
            BEGIN
            BONUS := 0.85*GAPOK;
            GATOT := BONUS+GAPOK;
            GOTOXY (4,14); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
            GOTOXY (4,15); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
            END;

            IF (GOLONGAN = 'B') THEN
            BEGIN
            BONUS := 0.85*GAPOK;
            GATOT := BONUS+GAPOK;
            GOTOXY (4,14); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
            GOTOXY (4,15); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
            END;

            IF (GOLONGAN = 'C') THEN
            BEGIN
            BONUS := 0.75*GAPOK;
            GATOT := BONUS+GAPOK;
            GOTOXY (4,14); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
            GOTOXY (4,15); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
            END;

            IF (GOLONGAN = 'D') THEN
            BEGIN
            BONUS := 0.75*GAPOK;
            GATOT := BONUS+GAPOK;
            GOTOXY (4,14); WRITELN ('Bonus Pekerjaan Anda: ', BONUS:8:2);
            GOTOXY (4,15); WRITELN ('GAJI TOTAL: ', GATOT:8:2);
            END;
     END;

     GOTOXY (14,17); WRITELN ('--Terima Kasih--');
     READLN;
END.

Related Posts Plugin for WordPress, Blogger...