[Show all top banners]

pythoner
Replies to this thread:

More by pythoner
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 Python Help!!!!
[VIEWED 5540 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 365 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
ANA and AJAY KUMAR DEV. RAPISTS CONVENTION
tesla stock OMG !!
TPS for Nepal likely to extend next week
Conservative discussions
सालीको चाक
TPS To F-1 COS
Embassy of Nepal might be able to help extend TPS for Nepal
I hope all the fake Nepali refugee get deported
Those who are in TPS, what’s your backup plan?
Homeland Security revokes temporary status for 532,000 Cubans, Haitians, Nicaraguans and Venezuelans
Venezuela TPS lawuit
ChatSansar.com Naya Nepal Chat
Who is hottest nepali female?
Looking for girl
TPS for Venezuela is terminated, only 60 days extension for transition period
TPS to F1 Status.
Nepal TPS has been Extended !!!
legal Query for married nepali girl now have taken US citizenship
Got my F1 reinstatement approved within 3 months(was out of F1 for almost 2 years)
Looking for girl
Who is hottest nepali female?
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