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. fantastic points altogether, you simply gained a brand new reader.

    What may you recommend about your put up that you just made some days ago?
    Any sure?

    Feel free to visit my webpage – Bryan

  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 could do with some pics to drive
    the message home a bit, but instead of that, this
    is wonderful blog. An excellent read. I will definitely be back.

    Also visit my web-site: anapa-alrosa.com.ru

  3. Hi, its good article regarding media print, we all know media is a fantastic source of data.

    Feel free to visit my page; Tesha

  4. I leave a response when I appreciate a post on a site or
    if I have something to add to the discussion. It is a result of
    the passion displayed in the post I read. And on this post Contoh
    Soal Pemrograman – Menghitung Biaya Parkir – Umar
    faisol. I was actually excited enough to drop a commenta response
    😛 I actually do have a couple of questions for you if it’s okay.

    Could it be only me or does it look like a few of the comments appear as if
    they are coming from brain dead folks? 😛 And, if you are posting at additional places,
    I’d like to keep up with you. Would you list every one of all your community
    pages like your twitter feed, Facebook page or linkedin profile?

    My homepage; http://www.fotosombra.com.br

  5. Hmm is anyone else encountering problems with the pictures on this blog loading?
    I’m trying to figure out if its a problem on my end or if
    it’s the blog. Any feed-back would be greatly appreciated.

    my web site: carb cycling

  6. Психолог Онлайн. Консультация у психолога Психологи онлайн.
    Рейтинг психологов. Консультация и
    лечение психотерапевта (психолога) Консультация у психологов.
    Консультация психолога онлайн.
    Услуги аналитического психолога, психотерапевта.

  7. Excellent blog here! Also your web site loads up very fast!

    What web host are you using? Can I get your
    affiliate link to your host? I wish my site loaded up
    as fast as yours lol

    Also visit my web-site :: eczema heals

Comments are closed.