Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions modul-4/250441100018_Fiorenza clarabelle quenetta sianturi/no1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
l = int(input("Masukkan jumlah baris lampu: "))

lampu = 1

for baris in range(1, l + 1):
b = int(input(f"Masukkan jumlah lampu di baris {baris}: "))

for _ in range(b):
if lampu % 3 == 0:
print(f"Lampu ke-{lampu} pada baris {baris} rusak.")
else:
print(f"Lampu ke-{lampu} pada baris {baris} menyala.")
lampu += 1
print()

if baris == l:
print("Periksa sambungan daya utama.")
90 changes: 90 additions & 0 deletions modul-4/250441100018_Fiorenza clarabelle quenetta sianturi/no2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
total_gaji = 0
total_lembur_jam = 0
total_bonus_malam = 0
total_biaya_lembur = 0
gaji_pokok = 100000

print("gaji pokok per hari adalah Rp100000")
print("Program perhitungan gaji karyawan selama 7 hari")
print("===============================================")
print()

for hari in range(1, 8):
while True:
shift_malam = input(f"Hari {hari}: Apakah hari ini anda shift malam? (y/n): ")
if shift_malam == "y":
bonus_malam = 50000
print(f"Anda mendapatkan bonus shift malam sebesar Rp{bonus_malam}")
break
elif shift_malam == "n":
bonus_malam = 0
print("Tidak ada bonus shift malam hari ini.")
break

while shift_malam == "y" or shift_malam == "n":
lembur = input("Apakah anda lembur hari ini? (y/n): ")
if lembur == "y":
break
elif lembur == "n":
jam_lembur = 0
bayaran_lembur = 0
print("Tidak ada bayaran lembur hari ini.")
print()
break

while lembur == "y":
jam_lembur = int(input(f"Masukkan jumlah jam lembur: "))
if jam_lembur == 0:
bayaran_lembur = 0
print("Tidak ada bayaran lembur hari ini.")
print()
break
elif 1 <= jam_lembur <= 3:
bayaran_lembur = 25000 * jam_lembur
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
print()
break
elif jam_lembur == 4:
bayaran_lembur = 100000
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
print()
break
elif jam_lembur == 5:
bayaran_lembur = 125000
print(f"Bayaran lembur untuk {jam_lembur} jam belum diatur dalam sistem.")
print()
break
elif jam_lembur == 6:
bayaran_lembur = 200000
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
print()
break
elif jam_lembur == 7:
bayaran_lembur = 225000
print(f"Bayaran lembur untuk {jam_lembur} jam belum diatur dalam sistem.")
print()
break
elif jam_lembur == 8:
bayaran_lembur = 300000
print(f"Bayaran lembur untuk {jam_lembur} jam adalah Rp{bayaran_lembur}")
print()
break
else:
bayaran_lembur = 0
print("lembur melebihi batas, tidak dihitung")
print()
break

gaji_hari = gaji_pokok + bayaran_lembur + bonus_malam
total_gaji += gaji_hari
total_lembur_jam = total_lembur_jam + jam_lembur
total_biaya_lembur += bayaran_lembur
total_bonus_malam += bonus_malam

print()
print("===============================================")
print(f"Total jam lembur: {total_lembur_jam}")
print(f"Total bayaran lembur: Rp{total_biaya_lembur}")
print(f"Total bonus shift malam: Rp{total_bonus_malam}")
print(f"Gaji pokok selama 7 hari: Rp{gaji_pokok * 7}")
print(f"Total gaji seminggu: Rp{total_gaji}")
19 changes: 19 additions & 0 deletions modul-4/250441100018_Fiorenza clarabelle quenetta sianturi/no3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
n = int(input("Masukkan jumlah baris: "))

for i in range(n, 0, -1):
for j in range(1, i + 1):
if j < 10:
print(j, end=' ')
else:
print(j, end=' ')

for s in range((n - i) * 6):
print(' ', end='')

for j in range(i, 0, -1):
if j < 10:
print(j, end=' ')
else:
print(j, end=' ')

print()