# Re: Programming Issues

Discussion in 'Python' started by Jason Friedman, Sep 20, 2012.

1. ### Jason FriedmanGuest

> Ask the user for the amount of change expressed in cents. Your program must
> compute and display the number of half-dollars, quarters, dimes, nickels,
> and pennies to be returned.
> Return as many half-dollars as possible, then quarters, dimes, nickels, and
> pennies, in that order.
> Your program must allow the user to continue entering different amounts of
> change until they enter 0 to indicate they are finished. If the user enters
> a negative number, inform them of their mistake and ask them to enter a
> correct value.

(http://en.wikipedia.org/wiki/Pseudo_code) and ask for help writing
that in Python. I'll get you started.

If number = 0, stop.
If number < 0, ask again.

With values 50, 25, 10, 5 and 1:
if number > value:
coincount = integer portion of number divided by value
print coincount, value
remaining number = ...

I've broken the pseudo-code into two parts because they are, in some
sense, different programs.
You might try to write one, then the other.
In other words, starting by writing this in Python: