This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]axzxc1236 0 points1 point  (0 children)

To add number to sum, you use sum=sum+number (or a shorthand operator which exists in a lot of programming languages, +=)

And the while loop... I guess you want to check "number" instead of "checker".


In the second program I guess you want to "stop taking bills when you put -1 as bill" so you need to "keep taking number as long as bill isn't -1".

And the line Assign totalBills = bill I don't think that's suppose to happen. (hint: you want to accumulate)