Skip to content

Commit 476d181

Browse files
250441100018_FiorenzaClarabelleQuenettaSianturi_Modul4_AsprakKakSalman
1 parent 020b19a commit 476d181

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
l = int(input("Masukkan jumlah baris lampu: "))
2+
3+
lampu = 1
4+
5+
for baris in range(1, l + 1):
6+
b = int(input(f"Masukkan jumlah lampu di baris {baris}: "))
7+
8+
for _ in range(b):
9+
if lampu % 3 == 0:
10+
print(f"Lampu ke-{lampu} pada baris {baris} rusak.")
11+
else:
12+
print(f"Lampu ke-{lampu} pada baris {baris} menyala.")
13+
lampu += 1
14+
print()
15+
16+
if baris == l:
17+
print("Periksa sambungan daya utama.")
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
total_gaji = 0
2+
total_lembur_jam = 0
3+
total_bonus_malam = 0
4+
total_biaya_lembur = 0
5+
gaji_pokok = 100000
6+
7+
print("gaji pokok per hari adalah Rp100000")
8+
print("Program perhitungan gaji karyawan selama 7 hari")
9+
print("===============================================")
10+
print()
11+
12+
for hari in range(1, 8):
13+
while True:
14+
shift_malam = input(f"Hari {hari}: Apakah hari ini anda shift malam? (y/n): ")
15+
if shift_malam == "y":
16+
bonus_malam = 50000
17+
print(f"Anda mendapatkan bonus shift malam sebesar Rp{bonus_malam}")
18+
break
19+
elif shift_malam == "n":
20+
bonus_malam = 0
21+
print("Tidak ada bonus shift malam hari ini.")
22+
break
23+
24+
while shift_malam == "y" or shift_malam == "n":
25+
lembur = input("Apakah anda lembur hari ini? (y/n): ")
26+
if lembur == "y":
27+
break
28+
elif lembur == "n":
29+
jam_lembur = 0
30+
bayaran_lembur = 0
31+
print("Tidak ada bayaran lembur hari ini.")
32+
print()
33+
break
34+
35+
while lembur == "y":
36+
jam_lembur = int(input(f"Masukkan jumlah jam lembur: "))
37+
if jam_lembur == 0:
38+
bayaran_lembur = 0
39+
print("Tidak ada bayaran lembur hari ini.")
40+
print()
41+
break
42+
elif 1 <= jam_lembur <= 3:
43+
bayaran_lembur = 25000 * jam_lembur
44+
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
45+
print()
46+
break
47+
elif jam_lembur == 4:
48+
bayaran_lembur = 100000
49+
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
50+
print()
51+
break
52+
elif jam_lembur == 5:
53+
bayaran_lembur = 125000
54+
print(f"Bayaran lembur untuk {jam_lembur} jam belum diatur dalam sistem.")
55+
print()
56+
break
57+
elif jam_lembur == 6:
58+
bayaran_lembur = 200000
59+
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
60+
print()
61+
break
62+
elif jam_lembur == 7:
63+
bayaran_lembur = 225000
64+
print(f"Bayaran lembur untuk {jam_lembur} jam belum diatur dalam sistem.")
65+
print()
66+
break
67+
elif jam_lembur == 8:
68+
bayaran_lembur = 300000
69+
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
70+
print()
71+
break
72+
else:
73+
bayaran_lembur = 0
74+
print("lembur melebihi batas, tidak dihitung")
75+
print()
76+
break
77+
78+
gaji_hari = gaji_pokok + bayaran_lembur + bonus_malam
79+
total_gaji += gaji_hari
80+
total_lembur_jam = total_lembur_jam + jam_lembur
81+
total_biaya_lembur += bayaran_lembur
82+
total_bonus_malam += bonus_malam
83+
84+
print()
85+
print("===============================================")
86+
print(f"Total jam lembur: {total_lembur_jam}")
87+
print(f"Total bayaran lembur: Rp{total_biaya_lembur}")
88+
print(f"Total bonus shift malam: Rp{total_bonus_malam}")
89+
print(f"Gaji pokok selama 7 hari: Rp{gaji_pokok * 7}")
90+
print(f"Total gaji seminggu: Rp{total_gaji}")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
n = int(input("Masukkan jumlah baris: "))
2+
3+
for i in range(n, 0, -1):
4+
for j in range(1, i + 1):
5+
if j < 10:
6+
print(j, end=' ')
7+
else:
8+
print(j, end=' ')
9+
10+
for s in range((n - i) * 6):
11+
print(' ', end='')
12+
13+
for j in range(i, 0, -1):
14+
if j < 10:
15+
print(j, end=' ')
16+
else:
17+
print(j, end=' ')
18+
19+
print()

0 commit comments

Comments
 (0)