Let's see:
1) If user inputs text, program crashes (not good)
Probably should use raw_input and put float() inside
a try block.
2) I can't figure out how program ever stops (e.g. b
is set to 1 and never reset to exit the while b!=0
loop).
3) Sales is mispelled in the last print statement
4) Use inplace incrementing (e.g. v+=s, s+=a)
instead of s=s+a, v=v+s
5) What is t variable used for?
Good Luck.
"Ryan Q." <RQ******@optonline.net> wrote in message
news:d1**************************@posting.google.c om...
It works, i'm just posting it hoping someone could do better.
print ''
print ' *** CASH REGISTER ***'
print ' PRESS 0 AND THEN ENTER TO TOTAL'
b = 1
t = 0
v = 0
while b != 0:
a = 1
s = 0
print ''
while a != 0:
a = input(' ITEM $ ')
s = s + a
print ' TOTAL $',s
v = v + s
cash = input(' CASH $ ')
change = cash - s
print ' CHANGE $',change
print ' '
print ' TOTAL SALES $ ',v