[Show all top banners]
Back to: Kurakani General Refresh page to view new replies
 Python Help!!!!
[VIEWED 3853 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 90 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
Toilet paper or water?
Mamta kafle bhatt is still missing
ढ्याउ गर्दा दसैँको खसी गनाउच
Tourist Visa - Seeking Suggestions and Guidance
Problems of Nepalese students in US
I hope all the fake Nepali refugee get deported
Are Nepalese cheapstakes?
and it begins - on Day 1 Trump will begin operations to deport millions of undocumented immigrants
From Trump “I will revoke TPS, and deport them back to their country.”
wanna be ruled by stupid or an Idiot ?
Sajha Poll: Who is your favorite Nepali actress?
अरुणिमाले दोस्रो पोई भेट्टाइछिन्
To Sajha admin
seriously, when applying for tech jobs in TPS, what you guys say when they ask if you have green card?
Travel Document for TPS (approved)
MAGA denaturalization proposal!!
How to Retrieve a Copy of Domestic Violence Complaint???
Nepali Psycho
advanced parole
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