Problem with change return problem.
I am writing a program that is supposed to take an amount of change the user imputs and then the program is supposed to output the number of quarters, dimes, nickles, and pennies needed to make up the amount given prior.
I get the program to run and able to input the change. When the output of coins is given you get the right number of qurters multiplied by 100. Ex. If you put in 75 for change you will get 300 for quarters, 3000 for dimes, etc, etc. The first digit is correct but the rest isn't.
It doesn't make sense to me. Are my equations written wrong or did I go about this the wrong way.
Thank you in advance and helping me work through this.
std::cout << "Amount of change: " ;
std::cin >> change ;
quarter = ( change / .25 ) ;
dime = ( change / .25 ) / .1 ;
nickle = ( ( change / .25 ) / .1 ) / .05 ;
pennie = ( ( ( change / .25 ) / .1 ) / .5 ) / .01 ;
std::cout << "Anount due:" << '\n' ;
std::cout << " quarters: " << quarter ;
std::cout << " dimes: " << dime ;
std::cout << " nickles: " << nickle ;
std::cout << " pennies: " << pennie ;