Cash Register

Greg Ewing greg at cosc.canterbury.ac.nz
Wed May 12 00:02:10 EDT 2004


Ryan Q. wrote:
> It works, i'm just posting it hoping someone could do better.
> 
> print ''
> print ' *** CASH REGISTER ***'
> print ' PRESS 0 AND THEN ENTER TO TOTAL'

I notice it's nicely agnostic about what kind
of numbers are used. This will come in very handy
if complex currency is ever introduced...

  ITEM          $ 3.50
  ITEM          $ 2.30j
  ITEM          $ 1+2j
  ITEM          $ 0
         TOTAL  $ (4.5+4.3j)
          CASH  $ 50
        CHANGE  $ (45.5-4.3j)

  TOTAL SLAES $  (4.5+4.3j)

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list