|
| 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}") |
0 commit comments