print(\"Welcome to BreakDown 2000.\") print(\"\") print(\"Here we will take your
ID: 3859252 • Letter: P
Question
print("Welcome to BreakDown 2000.")
print("")
print("Here we will take your total cents and break it down to the various denominations absoulutly free of charge.")
print("")
print("You will know exactly how much of each you will need without getting a brain tumor trying to figure it out yourself. Lets get started.")
print("")## Friendly welcome message to the user
num = int(input('Please input total cents(positive numbers only) ')) ##Asking user to input cents
hundredDollar = 0 ## Declaring of the various variables. All int & all set to a value of 0
fiftyDollar = 0
twentyDollar = 0
tenDollars = 0
dollars = 0
quarters = 0
dimes = 0
nickels = 0
pennies = 0
while num <= 0: ## Loop to make sure user inputs a positive number
print ("The number you have entered is invalid. Try again.")
num = int(input('Please input total cents(positive numbers only) '))
while num >= 10000: ## Loop to determin amount of $100
num = num - 10000
hundredDollar = hundredDollar +1
while num >= 5000: ## Loop to determin amount of $50
num = num - 5000
fiftyDollar = fiftyDollar + 1
while num >= 2000: ## Loop to determin amount of $20
num = num - 2000
twentyDollar = twentyDollar + 1
while num >= 1000: ## Loop to determin amount of $10
num = num - 1000
tenDollars = tenDollars + 1
while num >= 100: ## Loop to determin amount of $1
num = num - 100
dollars = dollars + 1
while num >= 25: ## Loop to determin amount of quarters
num = num - 25
quarters = quarters + 1
while num >= 10: ## Loop to determin amount of dimes
num = num - 10
dimes = dimes + 1
while num >= 5: ## Loop to determin amount of nickels
num = num - 5
nickels = nickels + 1
while num >= 1: ## Loop to determin amount of pennies
num = num - 1
pennies = pennies + 1
print ("")
print ('Hundred Dollars = $',hundredDollar,'Fifty Dollars = $',fiftyDollar,'Twenty Dollars = $',twentyDollar,'Ten Dollars = $',tenDollars,'One Dollars = $',dollars)
print ("")
print ('Quarters =',quarters,'Dimes =', dimes, 'Nickels =', nickels, 'Pennies =', pennies) ##Displays the result
print ("")
print ("Thank you for using BreakDown 2000. We hope you will come back the next time you need us.") ##User Friendly Dismissal message
Explanation / Answer
Answere for the given Question:
As i analyzed the question, it look likes correct it's workinf fine, see the below output.If you have any thing let me know.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.