[Show all top banners]
Back to: Kurakani General Refresh page to view new replies
 Python Help!!!!
[VIEWED 3078 TIMES]
SAVE! for ease of future access.
Posted on 04-02-13 5:07 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

 I'm trying to write atm code on Python.Here is the question.

The atm only dispense amount divisible by 5.The fee for each withdrawal is $0.5+1% of the amount cash withdrawn. After completing each transaction the bank rounds the balance to the closest whole value 67.9=67 ,78.1=78.

Input the list of integers, the first one denotes account balance the second is a list of money anmount to withdraw.
Output :account balance after all operations,Integer.

please give some hints ,suggestions..........
Any python gurus in sajha. Help will be appreciated.

 

Last edited: 02-Apr-13 05:10 PM

 
Posted on 04-02-13 9:25 PM     [Snapshot: 156]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

initialBalance = float (input('Enter the initial amount:'))

balanceToWithDraw = float (input("Enter the amount you want to withdraw"))

atmCharge = float (1/100* balanceToWithDraw + 0.05)
print ("The amount you have been charged was->")
print (atmCharge)

remainingBalance = float(initialBalance-(balanceToWithDraw + atmCharge))
print ("The remaining balance in your account is")
print ("Since we dont want to see any decimal numbers your remaining balance is::")
print (int(remainingBalance))

 
Posted on 04-02-13 9:27 PM     [Snapshot: 157]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

this shud get you started i think...
i dont know if its correct...
i did not check it yet.. i wish windows machines came with ruby and python pre-installed.
let me know if u get errors/...
Last edited: 02-Apr-13 09:30 PM

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 200 days
Recommended Popular Threads Controvertial Threads
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
शीर्षक जे पनि हुन सक्छ।
What are your first memories of when Nepal Television Began?
Sajha Poll: नेपालका सबैभन्दा आकर्षक महिला को हुन्?
ChatSansar.com Naya Nepal Chat
NRN card pros and cons?
Basnet or Basnyat ??
निगुरो थाहा छ ??
Nas and The Bokas: Coming to a Night Club near you
TPS Re-registration
अमेरिकामा छोरा हराएको सूचना
ओच्छ्यान मुत्ने समस्या ( confession )
Do nepalese really need TPS?
TPS Re-registration case still pending ..
Drawback for applying NRN card
Breathe in. Breathe out.
nrn citizenship
Democrats are so sure Trump will win
ढ्याउ गर्दा दसैँको खसी गनाउच
My facebook archive (for sale)
Nas and The Bokas: Coming to a Night Club near you
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
Harvard Nepali Students Association Blame Israel for hamas terrorist attacks
TPS Update : Jajarkot earthquake
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters