I am writing this program and trying to get the values of dollar, quarter, dime, nickel, and penny to add for the total money value. When the program runs, and adds them together, it adds up to an int with no decimal. Any idea what I am doing wrong?
You are not getting the monetary values of the coins. For that, you would need to multply the coins received by the coin value. ie: quarter = .25. Quarters received = 3. 3x.25 = .75.
All you're doing is taking the integer values of coin amounts, and adding them together, so, yes, you will get an integer answer. Use a different variable for coins received, then do the math on their values times the coins in hand.