Contoh Soal Pemrograman – Menghitung Biaya Parkir

Pemrograman Python

Berikut adalah contoh soal menggunakan bahasa pemrograman Python.

Buatlah program Python untuk menghitung biaya parkir di sebuah rumah sakit berdasarkan lama parkir. Lama parkir dihitung dari selisih jam masuk dan jam keluar. Jam masuk dan jam keluar diisi 1-24. Biaya parkir adalah Rp. 2.000,- per jam.

Contoh tampilan program:
Jam masuk    : 10 (input)
Jam keluar     : 14 (input)
Lama parkir  : 4 jam (keluaran program)
Biaya parkir  : 8000 (keluaran program)

Berikut kode program yang dapat dibuat untuk menyelesaikan soal tersebut.


jam_masuk = int(input("Jam Masuk  : "))
jam_keluar = int(input("Jam Keluar  : "))

lama_parkir = jam_keluar - jam_masuk
biaya_parkir = lama_parkir * 2000

print("Lama Parkir : ", lama_parkir)
print("Biaya Parkir : ", biaya_parkir)

3,444 thoughts on “Contoh Soal Pemrograman – Menghitung Biaya Parkir

  1. Наиболее показательным примером здесь является фильм «Прошлым летом в Мариенбаде», где пересекается

  2. Its like you read my mind! You appear to know so much
    about this, like you wrote the book in it or something. I think that you can do with some pics to drive the
    message home a little bit, but instead of that, this is great
    blog. An excellent read. I will certainly be back.

  3. You could certainly see your expertise in the work you write.
    The sector hopes for even more passionate writers such as you who aren’t afraid to say
    how they believe. At all times go after your heart.

  4. Hello, i believe that i noticed you visited my blog thus i got
    here to return the favor?.I am attempting to find
    things to enhance my web site!I guess its good enough to make use of some
    of your ideas!!

Comments are closed.