[Show all top banners]
Back to: Kurakani General Refresh page to view new replies
 Python Help!!!!
[VIEWED 3110 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 60 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
nrn citizenship
ढ्याउ गर्दा दसैँको खसी गनाउच
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
TPS Work Permit/How long your took?
Travelling to Nepal - TPS AP- PASSPORT
कल्लाई मुर्ख भन्या ?
Morning dharahara
महँगो अण्डाको पिकल्प : कुखुरा र खोर भाडामा लिने
Travelling on TPS advance travel document to different country...
काेराेना सङ्क्रमणबाट बच्न Immunity बढाउन के के खाने ?How to increase immunity against COVID - 19?
मन भित्र को पत्रै पत्र!
Informatica consultancy share
Are you ready to know the truth?
They are openly permitting undocumented immigrants to participate in federal elections in Arizona now.
चितवनको होस्टलमा १३ वर्षीया शालिन पोखरेल झुण्डिएको अवस्था - बलात्कार पछि हत्याको शंका - होस्टेलहरु असुरक्षित
Does the 180 day auto extension apply for TPS?
lost $3500 on penny stocks !!!
Another Song Playing In My Mind
जाडो, बा र म……
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