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
pythoner · Apr 2, 2013 5:07 PM · 9,285 views
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))
alece · Apr 2, 2013 9:25 PM
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
alece · Apr 2, 2013 9:27 PM
This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.
Start a New Discussion