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. Hey there! I’ve been following your weblog
    for some time now and finally got the courage to go ahead and give you a shout out from Atascocita Tx!

    Just wanted to mention keep up the excellent work!

  2. I have about 4-5 sites that are outdated and not used. I have a new blog @ blogspot and I would like to forward those domains so they show up on the blogspot address. How do I go about doing this? My domains are hosted by GoDaddy and are blank at the moment. I had originally forwarded them to another hosting company but they never built the sites..

  3. Incredible! This blog looks just like my
    old one! It’s on a totally different subject but it has
    pretty much the same layout and design. Great choice of colors!

  4. I’ve been browsing online greater than 3 hours
    lately, but I by no means found any fascinating article like yours.
    It is beautiful price sufficient for me. In my opinion,
    if all site owners and bloggers made good content material as you did, the internet
    shall be a lot more helpful than ever before.

  5. I have been surfing online more than three hours these days, but I never found any attention-grabbing article like yours.
    It is pretty price enough for me. In my view, if all site
    owners and bloggers made good content material as you probably did, the web will
    probably be much more useful than ever before.

  6. Hello just wanted to give you a quick heads up.
    The words in your article seem to be running off the screen in Safari.

    I’m not sure if this is a format issue or something to do with web browser compatibility but I thought
    I’d post to let you know. The layout look great though!
    Hope you get the issue solved soon. Kudos

  7. Pingback: amoxicillin sulfa
  8. My friends and i kind of determine %BT% must be.

    But the problem definitely is Need to distribute
    a essay or dissertation within this issue matter.
    How can I offer it finer? Precisely what information is important so as?

  9. Ahaa, its pleasant discussion concerning this post at this place
    at this weblog, I have read all that, so now me also commenting at this place.

  10. Ahaa, its pleasant conversation on the topic of this article
    here at this webpage, I have read all that, so at this time me also commenting
    at this place.

  11. I have been browsing online more than 4 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. Personally, if all webmasters and bloggers made good content as you did, the web will
    be a lot more useful than ever before.

  12. Pingback: celecoxib coupon
  13. Pretty element of content. I just stumbled upon your blog and in accession capital to claim that I acquire
    in fact loved account your weblog posts. Any way I’ll be
    subscribing in your feeds or even I achievement you get entry to consistently rapidly.

  14. A motivating discussion is definitely worth comment. I think that you should publish more
    on this topic, it may possibly not be described as
    a taboo matter but generally folks don’t speak about such issues.
    To the next! Best wishes!!

    Here is my blog – NorbertYTiro

  15. Ahaa, its pleasant conversation about this post at this place
    at this blog, I have read all that, so at this time me also commenting at this place.

  16. Ahaa, its fastidious dialogue regarding this piece of writing here
    at this weblog, I have read all that, so now me also commenting here.

Comments are closed.