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)

4,187 thoughts on “Contoh Soal Pemrograman – Menghitung Biaya Parkir

  1. Aw, this was an extremely good post. Taking the time and actual effort to create a really good article… but
    what can I say… I put things off a lot
    and don’t manage to get nearly anything done.

  2. It’s actually a nice and helpful piece of info. I am glad that you shared this helpful information with
    us. Please keep us informed like this. Thanks for sharing.

  3. Hi! Someone in my Facebook group shared this site with us so I came to check it out.

    I’m definitely enjoying the information. I’m bookmarking and
    will be tweeting this to my followers! Exceptional blog and
    terrific design and style.

  4. My coder is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the expenses.

    But he’s tryiong none the less. I’ve been using
    Movable-type on numerous websites for about a year and am nervous about switching to another platform.
    I have heard good things about blogengine.net.
    Is there a way I can import all my wordpress content into it?
    Any help would be really appreciated!

  5. Hi! Do you use Twitter? I’d like to follow you if that would be
    ok. I’m absolutely enjoying your blog and look forward to new posts.

  6. For latest information you have to pay a quick visit the web and on internet I
    found this site as a most excellent website for newest updates.

  7. Does your blog have a contact page? I’m having
    problems locating it but, I’d like to shoot you an e-mail.
    I’ve got some creative ideas for your blog you might be interested in hearing.
    Either way, great blog and I look forward to seeing it improve over time.

  8. This is very interesting, You are a very skilled blogger.
    I have joined your rss feed and look forward to seeking more
    of your excellent post. Also, I’ve shared your website in my social networks!

  9. I love your blog.. very nice colors & theme. Did you make this website
    yourself or did you hire someone to do it for you?
    Plz answer back as I’m looking to create my own blog and would like to find out where
    u got this from. many thanks

  10. I do believe all the ideas you have offered for your post.
    They’re really convincing and will definitely work.
    Nonetheless, the posts are very brief for newbies. May just
    you please prolong them a little from subsequent time?
    Thanks for the post.

  11. We absolutely love your blog and find nearly all of
    your post’s to be what precisely I’m looking for.
    can you offer guest writers to write content in your case?
    I wouldn’t mind creating a post or elaborating on a lot of the subjects you
    write related to here. Again, awesome website!

  12. I do consider all of the ideas you’ve introduced on your post.

    They’re very convincing and can definitely work. Still,
    the posts are very quick for starters. Could you please
    lengthen them a bit from subsequent time? Thank
    you for the post.

Comments are closed.