Skip to content

Commit b72b2a2

Browse files
committed
250441100006_MohammadIrfanHariyono_Modul4_AsprakKakSalman
1 parent 1ef742b commit b72b2a2

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
print("Program Pemantauan Lampu Taman oleh mas rusdi")
2+
3+
jmlh_baris = int(input("Masukkan total jumlah baris lampu : "))
4+
print("-" * 35)
5+
6+
for i in range(1, jmlh_baris + 1):
7+
print(f"\n Memeriksa Baris {i}")
8+
9+
jmlh_lampu = int(input(f"Masukkan jumlah lampu yang ada di baris {i} "))
10+
11+
for j in range (1, jmlh_lampu + 1):
12+
pesan_dasar = ""
13+
14+
if j % 3 == 0:
15+
pesan_dasar = f"Lampu ke - {j} pada baris {i} Rusak"
16+
else:
17+
pesan_dasar =f"Lampu ke - {j} pada baris {i} Nyala"
18+
19+
pesan_tambah = ""
20+
21+
if j == jmlh_lampu:
22+
pesan_tambah = " Periksa sambungan daya utama"
23+
24+
print(f"{pesan_dasar}{pesan_tambah}")
25+
26+
print("\n" + "=" * 35)
27+
print("Pengecekan selesai")
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
print(" Program Menghitung Gaji Mingguan Pak Wowo")
2+
3+
total_gaji_mingguan = 0
4+
total_jam_lembur = 0
5+
total_bonus_malam = 0
6+
7+
gaji_pokok = 100000
8+
bonus_malam = 50000
9+
jumlah_hari = 7
10+
11+
for hari in range (1, jumlah_hari + 1):
12+
print(f"\n Hari ke-{hari}")
13+
14+
gaji_harian = gaji_pokok
15+
bonus_lembur_harian = 0
16+
bonus_malam_harian = 0
17+
18+
while True:
19+
shift_malam = input(f"Apakah hari ke-{hari} shift malam (iya/tidak): ")
20+
pass
21+
22+
if shift_malam == "iya" or shift_malam == "tidak":
23+
break
24+
else:
25+
print("Error : Input harus 'iya' atau 'tidak'. Coba lagi yaa")
26+
27+
while True:
28+
jam_lembur = input(f"Masukkan jam lembur hari ke-{hari}: ")
29+
30+
input_angka_valid = True
31+
32+
if jam_lembur == "":
33+
input_angka_valid = False
34+
elif jam_lembur == 0:
35+
input_angka_valid == False
36+
else:
37+
for karakter in jam_lembur:
38+
if karakter not in "0123456789":
39+
input_angka_valid = False
40+
break
41+
if input_angka_valid:
42+
jam_lembur = int(jam_lembur)
43+
break
44+
else:
45+
print("Error : Input harus berupa angka bulat positif ( 1, 2, 3 ...). Coba inputkan lagi.")
46+
47+
if jam_lembur > 8 :
48+
print("Peringatan : Lembur melebihi batas (8 jam), bonus lembur tidak dihitung.")
49+
bonus_lembur_harian = 0
50+
elif jam_lembur == 8:
51+
bonus_lembur_harian = 300000
52+
elif jam_lembur == 6:
53+
bonus_lembur_harian = 200000
54+
elif jam_lembur == 4:
55+
bonus_lembur_harian = 100000
56+
elif 1 <= jam_lembur <= 3:
57+
bonus_lembur_harian = jam_lembur * 25000
58+
59+
if shift_malam == "iya":
60+
bonus_malam_harian = bonus_malam
61+
62+
total_jam_lembur += jam_lembur
63+
total_bonus_malam += bonus_malam_harian
64+
gaji_harian = gaji_pokok + bonus_lembur_harian + bonus_malam_harian
65+
total_gaji_mingguan += gaji_harian
66+
print("\n ========================================== ")
67+
print(" Rekapitulasi ")
68+
print("\n ========================================== ")
69+
print(f"Total Jam lembur pak wowo seminggu: {total_jam_lembur} jam")
70+
print(f"Total Bonus pak wowo shift malam: Rp{total_bonus_malam}")
71+
print(f"Total Gaji mingguan pak wowo: Rp{total_gaji_mingguan}")
72+
print("x" * 35)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
print(" Program Piramida Cermin pas Bjirka gabut ")
2+
3+
while True:
4+
n_string = input("Masukkan nilai n (misal : 5): ")
5+
6+
inputan_adalah_angka_valid = True
7+
8+
if n_string == "":
9+
inputan_adalah_angka_valid = False
10+
else:
11+
for karakter in n_string:
12+
if karakter not in "0123456789":
13+
inputan_adalah_angka_valid = False
14+
break
15+
if inputan_adalah_angka_valid:
16+
n = int(n_string)
17+
18+
if n > 0:
19+
break
20+
else:
21+
print("Hemmm error guys Nilai n mu harus lebih besar dari 0. try on bruh ")
22+
else:
23+
print("Hemmm error lah input mu itu loh harus angka bulat positif (1, 2, 3...)")
24+
25+
print("=" * 30)
26+
27+
for i in range (n, 0, -1):
28+
29+
for j in range (1, i + 1):
30+
if j < 10:
31+
print(j, end=" ")
32+
else:
33+
print(j, end=" ")
34+
35+
36+
jumlah_spasi_ditengah = 6 * (n - i)
37+
38+
for k in range(jumlah_spasi_ditengah):
39+
print(" ", end="")
40+
41+
for l in range (i, 0, -1):
42+
if l < 10:
43+
print(l, end=" ")
44+
else:
45+
print(l, end=" ")
46+
47+
print()
48+
49+
print("=" * 30)
50+
print("Pola mu selesai bjirka, semoga kamu tenang yaa😊")

0 commit comments

Comments
 (0)