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. Good day! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted
    keywords but I’m not seeing very good gains. If you know of any
    please share. Appreciate it!

  2. excellent submit, very informative. I’m wondering why the other experts of this sector don’t notice this.
    You must proceed your writing. I am sure, you have a
    huge readers’ base already!

  3. It’s very straightforward to find out any matter on web
    as compared to books, as I found this piece of
    writing at this web page.

  4. This site truly has all of the information and facts I needed
    about this subject and didn’t know who to ask.

    Feel free to visit my blog post … kebe.top

Comments are closed.