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,199 thoughts on “Contoh Soal Pemrograman – Menghitung Biaya Parkir

  1. Here are some of the houses for sale that could be your next home. 28’ foot home with side entry is one of our larger homes, includes a main floor separate living room, extensive kitchen cabinetry and counter space. Dual large lofted bedrooms offer plenty of sleeping or lounging space, stair option available. Residential sized bathroom with 48″ shower (60″ shower or tub shower available) includes a large linen cabinet, toilet and sink with base cabinet. The Horseshoe is one of our most unique floor plans. Thanks to the tiny house movement, more homeowners are seeing the benefits of downsizing. If reducing your carbon footprint and saving money appeals to you, consider purchasing land in the Adirondacks for your tiny house. Search hundreds of top-quality mobile home models in Seguin. From 2 1 economy models, to 3 2 family-sized homes, to luxury 4 3 models, to simple 1 1 tiny home park models all the way up to massive modular home options! http://kult.adni86.alfahosting.org/wordpress/community/profile/redabarnhart52/ In 2014, Israel stopped granting permits to relatives unless they are listed as agricultural workers on larger plots. In 2017, the military began dividing larger holdings among the members of extended families and ruled that anything smaller than 330 square meters (3,500 square feet) was agriculturally unsustainable. Owners of so-called “tiny plots” are denied permits. We’ve created your account—please check your email to set your password. This has prepared the whole estate for residential and commercial development, which will include circa 200 homes with the remaining useable area allocated for employment use. In 2014, Israel stopped granting permits to relatives unless they are listed as agricultural workers on larger plots. In 2017, the military began dividing larger holdings among the members of extended families and ruled that anything smaller than 330 square meters (3,500 square feet) was agriculturally unsustainable. Owners of so-called “tiny plots” are denied permits.

  2. I do agree with all of the ideas you’ve offered to your
    post. They’re very convincing and can certainly work.
    Still, the posts are very short for newbies. May you please lengthen them a bit
    from subsequent time? Thanks for the post.

Comments are closed.