Kali ini saya akan sharing tentang program pascal, yaitu program Gaji Karyawan. Mudah-mudahan bermanfaat. Baik langsung saja......
Program Gaji_Karyawan;
uses crt;
var
nama, alm : string;
gapok, tot, tun : real;
gol, stt : char;
status, naik : boolean;
begin
clrscr;
write('Masukkan Nama : '); readln(nama);
write('Masukkan Alamat : '); readln(alm);
repeat
write('Masukkan Status [ M/T/D/J ] : '); readln(stt);
if (stt = 'M') or (stt = 'm') or
(stt = 'T') or (stt = 't') or
(stt = 'D') or (stt = 'd') or
(stt = 'J') or (stt ='j') then
naik := true
else
naik := false;
until naik = true;
repeat
write('Masukkan Golongan [ A/B ] : '); readln(gol);
if (gol='A') or (gol='a') or (gol='B') or (gol='b') then
status:= true
else
status:= false;
until status = true;
if (gol = 'A') or (gol = 'a') then
gapok := 500000
else
if (gol = 'B') or (gol = 'b') then
gapok := 1000000;
if (stt = 'm') or (stt = 'M') then
tun := 0.1 * gapok
else
if (stt = 'tm') or (stt = 'TM') and
(stt = 'D') or (stt = 'd') and
(stt = 'J') or (stt ='j') then
tun := 0;
tot := gapok + tun;
writeln;
writeln('======================================');
writeln('Nama : ',nama);
writeln('Alamat : ',alm);
writeln('Status : ',stt);
writeln('Gaji Pokok : ',gapok:0:0);
writeln('Gaji Total : ',tot:0:0);
readln;
end.
Ini Hasil Running'nya....
Tidak ada komentar:
Posting Komentar