Hey guys. I need help desperetley. I do not know where else to turn and need this turned in very soon! I am writing a program that accepts a value of money (an even integer value) and tells you the least amount of hundred dollar bills, fifties, twenties, tens, fives, and ones that it will take to make that total. (Example, i enter an amount of $150 and it tells me that i have 1 one hundred dollar bill and 1 fifty dollar bill) . To do this i am writing my own function named change () and am using reference parameters. I am really having a difficult time with this program...below is some code that I have but need a lot of help and would GREATLY appreciate some help! Thanks
Code:
#include <iostream>
using namespace std;
int change(int&, int&, int&, int&, int&, int&);
int main ()
{
int money;
cout << "How much money do you have?\n";
cin >> money;
int change (int hund, int fift, int twent, int ten, int five, int one);
system ("pause");
return 0;
}
int change (int& h, int& f, int& t, int& tenn, int& f, int& o)
{
int hundred = 100;
int fifty = 50;
int twenty = 20;
int ten = 10;
int five = 5;
int one = 1;
int tothund;
int totfift;
int tottwent;
int totten;
int totfive;
int totone;
tothund = hundred / 100;
totfift = fifty / 50;
tottwent = twenty / 20;
totten = ten / 10;
totfive = five / 5;
totone = one /1;
cout << tothund << endl;
cout << totfift << endl;
cout << tottwent << endl;
cout << totten << endl;
cout << totfive << endl;
cout << totone << endl;
return ;
}