Trying to have an American coin calculator than asks you how many coins you have for each value and then gives out the total(sum). After tweaking and looking up different results I still haven't found a correct solution. Help!
> After tweaking and looking up different results I still haven't found a correct solution.
Do you know how to do this on paper, or are you just trying random formulae.
If I gave you three pennies and a dime, what would you expect to be printed?
I'm trying to configure it so it would be say $0.13.
Attempting to figure things out myself so I am trying different things. I've seen an example of the reverse ( Dollars into Coins) and other similar problems so yes, I'm testing multiple formulae.
Just started learning for myself and reading online guides(such as this website!), experimenting on questions is sort of my way to combine information and really wrapping things together for me. Hopefully I don't come out being completely idiotic.
Hopefully I don't come out being completely idiotic.
You did already, well, not completely. But that is of minor importance. Most essential is that you dared to ask. Never stop asking! Or to quote Einstein: "The important thing is not to stop questioning. Curiosity has its own reason for existing."
In addition you may realize the differences:
-- why float total instead of integer,
-- why + nickels * 5 instead of + nickels + 5,
-- why converting pennies to USD by /100. instead of just /100 (without decimal point).
And, minor, why unsigned quarters ... instead of double quarters...? Well, money has no sign attached, neither + nor -, it is up to you how to account movements.
(And in case you have so many coins you'd rather go to the next bank and get them start their coin counting machine for a small fee.)