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. magnificent put up, very informative. I ponder why the opposite experts of this sector don’t understand
    this. You must proceed your writing. I’m sure, you have a great
    readers’ base already!

  2. You actually make it appear so easy together with your presentation but I find this
    topic to be actually one thing that I think I might by
    no means understand. It seems too complicated and extremely extensive for me.
    I am taking a look forward in your subsequent put up, I will attempt to get the hold of it!

  3. I’ve been browsing online greater than 3 hours nowadays, but I never discovered any
    attention-grabbing article like yours. It is lovely price
    sufficient for me. Personally, if all webmasters and
    bloggers made excellent content as you did, the net shall
    be a lot more helpful than ever before.

  4. I was wondering if you ever considered changing the structure
    of your site? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having one or 2 images.

    Maybe you could space it out better?

  5. Hi there! I’m at work browsing your blog from my
    new apple iphone! Just wanted to say I love reading your blog and look forward to all
    your posts! Keep up the excellent work!

  6. Hi, I do think your site might be having web browser compatibility
    issues. When I take a look at your web site in Safari,
    it looks fine but when opening in Internet Explorer, it’s got some overlapping issues.
    I just wanted to provide you with a quick heads up! Besides that, wonderful site!

Comments are closed.