-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHitungGajiKaryawan.pas
73 lines (66 loc) · 1.69 KB
/
HitungGajiKaryawan.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
program HitungGajiKaryawan;
uses
crt, SysUtils;
procedure HitungGajiKaryawan();
var
nama, golongan: String;
is_again: Char;
gaji, upahLembur, totalGaji, jamLembur, uangLembur: LongInt;
begin
while true do
begin
// input info nama, golongan, jamLembur
write('Masukkan nama : ');
read(nama);
write('Golongan : ');
read(golongan);
write('Banyak jam lembur : ');
read(jamLembur);
// cek golongan
if (golongan = '1a') then
begin
gaji := 5000000;
uangLembur := 2500;
end
else if (golongan = '1b') then
begin
gaji := 7500000;
uangLembur := 3500;
end
else if (golongan = '1c') then
begin
gaji := 8500000;
uangLembur := 5000;
end
else
begin
// do ... anything
end;
// process
upahLembur := uangLembur * jamLembur;
totalGaji := gaji + upahLembur;
// cetak info
writeln();
writeln('| ---- Info Pegawai -----');
writeln('| Nama Pegawai : ', nama);
writeln('| Golongan : ', golongan);
writeln('| Jam Lembur : ', jamLembur);
writeln();
writeln('| -- Info Gaji Pegawai --');
writeln('| Gaji : Rp.', gaji);
// cetak info total gaji
writeln('| Upah Lembur : Rp. ', upahLembur);
writeln('| -----------------------');
writeln('| Total Gaji : Rp.', totalGaji);
// ulang lagi
writeln();
write('Lakukan lagi ?? [y/n] ');
read(is_again);
if (is_again = 'n') then
exit ;
end;
end;
begin
// panggil procedure nya
HitungGajiKaryawan();
end.